PL/SQL: How to handle OUT Parameter during INSERT

610 pts.
Tags:
INSERT statement
Parameters
PL/SQL
PL/SQL block
SELECT statement
SQL statements
HI Experts, I have a OUT parameter in my procedure(whihc performs INSERT data into a table),how to handle this OUT parameter (primary key of table) -- Will Insert statement inside the PL/SQL block should include this parameter or we should use SELECT stm after Insert to add this attribute ,i am unclear on this please guide me

Answer Wiki

Thanks. We'll let you know when a new response is added.

I’m not sure if this is what you mean, but if what you want is to put one of the inserted values into an out parameter, you could use the RETURNING clause in the INSERT statement.

Something like this:

<pre>insert into test (field1,field2,field3) values (1,2,3)
Returning field3 into out_parameter_x;</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: