Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Need help with SQL Worksheet

Need help with SQL Worksheet

From: Eric Jodoin <ejodoin_at_inetex.com>
Date: Wed, 22 Jul 1998 01:23:26 -0700
Message-ID: <35b5a409.0@204.239.181.11>


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 Wed Jul 22 1998 - 03:23:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US