Greetings,
I am still new to PL/SQL and attempting to create a stored procedure that would allow me to check to see if a user exists in login table. The end goal is to have a user login to an ASP.net web application and have a stored procedure validate the user exists in the user table.
To start, I just want to test the SP only from the DB. So, I am wondering how I can set the parameter with a value to imitate an application passing a value into that parameter.
Here is my code for the SP that was compiled without error.
CREATE OR REPLACE PROCEDURE SP_LOGIN_CHK
(
P_USRNAME IN VARCHAR2
) IS
v_login_id VARCHAR2(20);
BEGIN
select login_id
into v_login_id
from login_user where v_login_id = p_usrname;
END SP_LOGIN_CHK;
Here is what I am using to execute the stored procedure...
exec sp_login_chk('Chris');
I am getting a 'No data found' error. However, when I run this query against the database I get 1 row returned.
select login_id from login_user where login_id = 'Chris';