From: Lee C. <lee...@ad...> - 2003-07-24 15:59:07
|
>What is the function of the SP ?? Here is the stored procedure. Could you just write me code of how YOU = would execute this stored procedure? It takes in a username and = userpassword, and it returns a userloginid and a userprivilegeid. //// code //// CREATE PROCEDURE LOGINUSER ( USERLOGINNAME VARCHAR(255), USERLOGINPASS VARCHAR(255)) RETURNS ( USERLOGINID INTEGER, USERPRIVILEGEID SMALLINT) AS begin select distinct userid, privilegeid from authenticate where = username=3D:userloginname and userpass=3D:userloginpass into :userloginid, :userprivilegeid; =20 if (:userloginid is null) then begin userloginid =3D 0; end =20 if (:userprivilegeid is null) then begin userloginid =3D 0; end =20 suspend; end //////////////// >If you are using ExecuteReader, you need to close the reader before=20 >commit the transaction. I closed the reader first and then commited. It executed fine, but no = results in the database. |