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 -> Re: Newbie Function Question Can you help ?

Re: Newbie Function Question Can you help ?

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 21 Jul 1998 06:43:47 GMT
Message-ID: <6p1db3$j7n$2@news02.btx.dtag.de>


Hi,

the second function pointed in the right direction, you just ommitted to say to oracle where to select from:

CREATE OR REPLACE FUNCTION "CSS_User".DEPID2 RETURN INTEGER IS
  A_INT NUMBER(10,0) ;
BEGIN

  	select
		DEPTID_SEQ.nextval
  	into 
		A_INT 
	FROM
		DUAL;
  	Return(A_INT) ;

END ; Eric Jodoin schrieb:
>
> 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

--

Regards

Matthias Gresz :-)

GreMa_at_t-online.de

          /|
         / |        
        /| |\
       /||  |\
      / O    |\         
     |        |\ Galopping Horse beats Running Man.
    /          |\
   /      /     |\
  /    __/|      |\
  \°   /  |       |\
   \/_/   |        |\


Received on Tue Jul 21 1998 - 01:43:47 CDT

Original text of this message

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