Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> RE: Need help with SQL Worksheet
After the END;, try putting a /
-----Original Message-----
From: Eric Jodoin
Sent: Wednesday, July 22, 1998 1:23 AM
To: CMP; comp.databases.oracle.misc
Subject: Need help with SQL Worksheet
Hi,
I have the following code in a SQL file. If I open it and try to run it I get:
MGR-00073: Warning: FUNCTION .s_useraccessdm created with compilation errors.
It looks like the Create Function and Create trigger mix together instead of being 2 independent command.
I know I have to be missing something between those 2 but I look through all my books and I just can't figure it out. Here is the code i used:
/* My Function */
CREATE OR REPLACE FUNCTION "S_USERACCESSDM".NEWDEPID
RETURN INTEGER IS
NEW_ID INTEGER ;
BEGIN
Select DEPTID_SEQ.nextval into NEW_ID from dual ;
RETURN(NEW_ID) ;
END ;
/* My Trigger */
CREATE OR REPLACE TRIGGER "S_USERACCESSDM".Department_Bit
BEFORE INSERT ON "S_USERACCESSDM"."DEPARTMENT"
FOR EACH ROW
BEGIN
IF (:new.DEPTID IS NULL) THEN
select DEPTID_SEQ.nextval
into :new.DEPTID
from Dual;
END IF;
END ;
Thanks for your help.
Received on Thu Jul 23 1998 - 11:51:44 CDT
![]() |
![]() |