Home » SQL & PL/SQL » SQL & PL/SQL » How to get Procedure values into a Local Variable (Oracle 10.2.0.1.0,Windows XP)
How to get Procedure values into a Local Variable [message #380847] Tue, 13 January 2009 10:27 Go to next message
kumarbo7
Messages: 19
Registered: March 2008
Location: New Jersey
Junior Member
Hi,

How to get values of stored procedure into local variable.

Here is the quick idea for further proceddings


l= (fgt_csc_pub.get_csc_id)
l_csc_id = l || '(' p_csc_id'||')
exec(l_csc_id);


Please let me know which one will be the better approach,is there any way by using dynamic sql?

Thanks in advance
-Kumar


Re: How to get Procedure values into a Local Variable [message #380854 is a reply to message #380847] Tue, 13 January 2009 10:35 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Explain in WORDS what you are trying to do.
What is your need?

Regards
Michel
Re: How to get Procedure values into a Local Variable [message #380857 is a reply to message #380854] Tue, 13 January 2009 10:43 Go to previous messageGo to next message
kumarbo7
Messages: 19
Registered: March 2008
Location: New Jersey
Junior Member
I have a procedure inside the package,want to get data into the local variable which are available in specific procedure by using dynamic sql

for example here is the 
package.procedure  ==> fgt_csc_pub.get_csc_id

local variable ==>     l_csc_id = l||'('p_csc_id '||')

                       EXEC(l_csc_id)

Thanks in advance
-Kumar







Re: How to get Procedure values into a Local Variable [message #380858 is a reply to message #380857] Tue, 13 January 2009 10:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I have a procedure inside the package,want to get data into the local variable which are available in specific procedure by using dynamic sql

So do it.

Regards
Michel
Re: How to get Procedure values into a Local Variable [message #380860 is a reply to message #380858] Tue, 13 January 2009 10:54 Go to previous messageGo to next message
kumarbo7
Messages: 19
Registered: March 2008
Location: New Jersey
Junior Member
Michel,

please let me know if am not clearly explaning.

sorry to mention I dont have more information regarding this.that is the reason am asking tech gurus like you to show me a right way so that I can go head and implement the logic under your guidance

Thanks in advance
-Kumar
Re: How to get Procedure values into a Local Variable [message #380862 is a reply to message #380847] Tue, 13 January 2009 10:57 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you.

Dynamic SQL scales as well as a pig can fly.
Re: How to get Procedure values into a Local Variable [message #380882 is a reply to message #380857] Tue, 13 January 2009 14:52 Go to previous message
Ora_works
Messages: 6
Registered: April 2008
Junior Member
kumarbo7, your question is not clear, is this what you are asking for

Quote:


DECLARE
L NUMBER;
l_csc_id VARCHAR2(10);

PROCEDURE GET_VALUE (P_L OUT NUMBER)
IS
BEGIN
P_L := 1+1;
END;

BEGIN

GET_VALUE(L);
l_csc_id := L || 'XYZ';

DBMS_OUTPUT.PUT_LINE(L_CSC_ID);


END;




Previous Topic: Adding additional columns to query
Next Topic: Errors while trying to create object Tables,kindly help.
Goto Forum:
  


Current Time: Fri Dec 02 16:28:21 CST 2016

Total time taken to generate the page: 0.19659 seconds