PL/SQL: How to handle OUT Parameter during INSERT

610 pts.
Tags:
INSERT statement
OUT 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
ASKED: December 15, 2008  6:56 AM
UPDATED: December 17, 2008  5:16 PM

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following