I'm running Oracle SQL developer and I've got the following Stored Procedure. I'm quite new to this but really not sure why this isn't working:
CREATE OR REPLACE PROCEDURE CHECKDUPLICATE(
username1 IN USERS.USERNAME%TYPE,
o_username OUT USERS.USERNAME%TYPE
)
IS
BEGIN
SELECT USERNAME
INTO o_username
FROM USERS WHERE username1 = o_username;
END;
When I try to call it:
DECLARE
o_username USERS.USERNAME%TYPE;
BEGIN
CHECKDUPLICATE('Jacklin', o_username);
DBMS_OUTPUT.PUT_LINE('username : ' || o_username);
END;
I get the error message:
Error starting at line 1 in command:
DECLARE
o_username USERS.USERNAME%TYPE;
BEGIN
CHECKDUPLICATE(Jacklin, o_username);
DBMS_OUTPUT.PUT_LINE('username : ' || o_username);
END;
Error report:
ORA-06550: line 5, column 19:
PLS-00201: identifier 'JACKLIN' must be declared
ORA-06550: line 5, column 4:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
What does it mean by "Identifier 'Jacklin' must be declared? (Table is called USERS, and column name is called USERNAME). Any help would be appreciated.
EDIT** I put Jacklin in quotes, and I get this message now:
Error report:
ORA-01403: no data found
ORA-06512: at "L13JAV04.CHECKDUPLICATE", line 9
ORA-06512: at line 6
01403. 00000 - "no data found"
*Cause:
*Action:
Even though Jacklin does it exist in the database!