Get Return Value from Function without SELECT [message #662521] |
Thu, 04 May 2017 16:48 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/7deb45a280ea95fbd5a66ac0c60538c2?s=64&d=mm&r=g) |
whdyck
Messages: 25 Registered: May 2017
|
Junior Member |
|
|
Maybe a bonehead question ....
Normally, when I need a return value from a function, I do
SELECT {function call} FROM DUAL;
My challenge is that I need to run a function that inserts a new record to another table and returns the PK of the newly created record.
Unfortunately, if I run this using the above SELECT syntax, Oracle fails and says that it cannot do an INSERT or UPDATE as part of a SELECT statement.
How then would I accomplish this without a SELECT?
I can do this with a BEGIN/END block, but then how do I get at the return value?
Thanks.
Wayne
|
|
|
|
|
|
|
|
|
|
|