I am having difficulty passing values from an Oracle Stored Procedure to
Cold Fusion.

Here is the stored procedure:

==========================================
CREATE OR REPLACE procedure dlc_sp_verifyLogin (
sLogin IN varchar2,
sPassword IN varchar2,
sRemoteAddr IN varchar2,
sBrowser IN varchar2,
screen IN varchar2,
studentID OUT number,
success OUT int
)

as

FAILEDLOGIN exception;

begin

studentID := 0;
success := 1;

select
s.sID into studentID
from
tblUser u,
tblStudentInfo s
where
u.USRLOGIN = sLogin and
u.USRPWD = sPassword and
'{'||s.USERID||'}' like u.USRID;

if ( studentID = NULL ) then
raise FAILEDLOGIN;
end if;

studentID := sidGrabbed;

insert into tblTrace
(dIP, dStudent, dDate, dAttLog, dAttPass, dUser, dType, dScreen)
values
(sRemoteAddr, studentID, current_date, sLogin, sPassword,
substr(sBrowser, 1, 200), 's',
screen);

exception
when FAILEDLOGIN then
success := 0;
insert into tblTrace
(dIP, dStudent, dDate, dAttLog, dAttPass, dUser, dType, dScreen)
values
(sRemoteAddr, '', current_date, sLogin, sPassword, substr(sBrowser,
1, 200), 's', screen);

end dlc_sp_verifyLogin;
/
==========================================

and here is where I call it in Cold Fusion:

==========================================
<cfstoredproc datasource="DLCampus" procedure="dlc_sp_verifyLogin"
debug="yes">
<cfprocresult name="loggedIn">
<cfprocparam type="in" dbvarname="sLogin" value="#trim(FORM.sLogin)#"
cfsqltype="cf_sql_varchar">
<cfprocparam type="in" dbvarname="sPassword"
value="#trim(FORM.sPassword)#" cfsqltype="cf_sql_varchar">
<cfprocparam type="in" dbvarname="sRemoteAddr"
value="#CGI.REMOTE_HOST#" cfsqltype="cf_sql_varchar">
<cfprocparam type="in" dbvarname="sBrowser"
value="#cgi.http_user_agent#" cfsqltype="cf_sql_varchar">
<cfprocparam type="in" dbvarname="screen" value="#screenSize#"
cfsqltype="cf_sql_varchar">
<cfprocparam type="out" dbvarname="success" variable="successCode"
cfsqltype="cf_sql_integer">
<cfprocparam type="out" dbvarname="studentID" variable="cookieID"
cfsqltype="cf_sql_integer">
</cfstoredproc>

==========================================

Now, I *should* be able to reference cookieID in my Cold Fusion page by
doing this:

<cfoutput query="loggedIn">#cookieID#</cfoutput>

or by doing this:

<cfoutput>#loggedIn.cookieID#</cfoutput>

Unfortunately, neither of these works.  With the latter I get this error
message:

"Element COOKIEID is undefined in LOGGEDIN."

With the former, I get an error message telling me that the attribute
name "loggedIn" is invalid.

What am I doing wrong?  The Cold Fusion code is almost identical for the
SQL Server database we were using, and works just fine.

--
Richard S. Crawford
Programmer/Analyst III,
UC Davis Extension Distance Learning Group
(916)327-7793 / [EMAIL PROTECTED]
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to