Hello Experts,
version : 10.1.0.5
I am a novice in pl/sql programming. i am trying to create a procedure which checks if a value exists in a column and if it does not it inserts .Below is the procedure and the errors,
SQL> CREATE OR REPLACE PACKAGE BODY manr.audit_pkg IS
2 PROCEDURE audit_proc(p_sessionid number,p_username VARCHAR2,p_date date) IS
3 BEGIN
4 if p_sessionid not in(select sessionid from manr.audit_history)
5 then
6 INSERT INTO manr.audit_history VALUES (p_sessionid,p_username, p_date);
7 Commit;
8 end if;
9 END;
10 END audit_pkg;
11 /
Warning: Package Body created with compilation errors.
SQL> show error
Errors for PACKAGE BODY MANR.AUDIT_PKG:
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/1 PL/SQL: Statement ignored
4/22 PLS-00405: subquery not allowed in this context
Could you please tell me where i am going wrong.Thanks for your help.
Rocky