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

Home -> Community -> Usenet -> c.d.o.server -> Newbie Question on Function

Newbie Question on Function

From: Eric Jodoin <ejodoin_at_inetex.com>
Date: Mon, 20 Jul 1998 16:22:17 -0700
Message-ID: <35b3d3b4.0@204.239.181.11>


Hi,

  I am trying to have a function return a sequence.Nextval but it just doesn't work!

1st I created the Sequence (This worked OK)   The sequence Name is: DEPTID_SEQ

Then I created the Function but I get compile errors   Here two of my tries (I tried dozens):

CREATE OR REPLACE FUNCTION "CSS_User".DEPID2 RETURN INTEGER IS
BEGIN
  RETURN(DEPTID_SEQ.NEXTVAL) ;
END ; I also tried

CREATE OR REPLACE FUNCTION "CSS_User".DEPID2 RETURN INTEGER IS
  A_INT NUMBER(10,0) ;
BEGIN
  select DEPTID_SEQ.nextval
  into A_INT ;
  Return(A_INT) ;
END ; Can someone tell me What I am doing wrong please ???

eric
ejodoin_at_inetex.com Received on Mon Jul 20 1998 - 18:22:17 CDT

Original text of this message

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