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: insert in function not possible?

Re: insert in function not possible?

From: Peter-Paul van de Beek <P.P.v.d.Beek_at_a2000.com>
Date: Tue, 15 Dec 1998 16:51:10 +0100
Message-ID: <3676856E.3EFF5B5D@a2000.com>


It is possible. You forgot to declare the return datatype.

Jan Rosinowski wrote:

> in sqlaw it's common practice to use functions like
>
> create function f_newfoo(bar varchar)

return <datatype>

> as
> begin
> insert into foo(b) values (bar);

     return <return_value>;

> end;
>
> try this in oarcle gives an ora-6571 ?!
>
> what's wrong? why can't i modify the database in a function? using a
> stored proc seems to work but actually it's crap to use a procedure
> with an out-parameter to simulate a function.
>
> how do i retrieve the current sequencevalue correctly?

select sequence_name.currval from dual;

>
>
> ciao, jan

Good luck,

Peter-Paul van de Beek Received on Tue Dec 15 1998 - 09:51:10 CST

Original text of this message

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