Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie Question on Function
Eric Jodoin wrote:
> ...
> 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
Try
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 ;
because a select must have a from and dual is a pseudotable jsut for
something like that.
You can test your function in sqlplus through
select depid2 from dual;
assuming you did grant execute to the user you are connected.
Hope this helps
Helmut Received on Tue Jul 21 1998 - 02:22:01 CDT
![]() |
![]() |