Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input/Output in stored procedure

Status
Not open for further replies.

696796

Programmer
Aug 3, 2004
218
GB
Hi, i have the following sp in which i am passing in two values (i_username, i_password) and want i_role_id to come out. The problem i'm having is that i cant get the role id into i_role_id. The error msg i'm getting is :-

PL/SQL: SQL Statement ignored
PL/SQL: ORA-00933: SQL command not properly ended

which occurs on the line 'into i_role_id'

Code:
CREATE OR REPLACE  PROCEDURE sp_login
(
    i_user_name		IN	tbl_user.user_name%TYPE,
    i_password  	IN	tbl_user.password%TYPE,
    i_role_id		OUT	tbl_roles.role_id%TYPE
)
IS

    cnumber number;

    cursor c1 is
    select user_id
      from tbl_user
      where user_name = i_user_name;

BEGIN

open c1;
fetch c1 into cnumber;

select role_id from tbl_user_access
'error occurs here
into i_role_id
where cnumber = user_id;

close c1;
END;
/

show errors
/

can anyone see what i'm doing wrong?

many thanks,

Alex
 
Hello Alex,

Your Code
select role_id from tbl_user_access
'error occurs here
into i_role_id
where cnumber = user_id;

Whereas this code should be
Code:
select role_id [b]into i_role_id[/b]
from tbl_user_access
'error occurs here
where cnumber = user_id;

Regards,
Gunjan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top