Home » SQL & PL/SQL » SQL & PL/SQL » executing a string in oracle......
executing a string in oracle...... [message #1944] Wed, 12 June 2002 07:14 Go to next message
mani
Messages: 105
Registered: September 1999
Senior Member
Hi,
i am populating an insert into statemnt at run time in a string....

how should i execute that string(i.e.dynamci insert into statement)...

pls help me...
thanks in advance...
mani
Re: executing a string in oracle...... [message #1949 is a reply to message #1944] Wed, 12 June 2002 08:26 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
v_string := 'insert into ...';
execute immediate v_string;


If possible, try to use bind variables:

v_string := 'insert into t (a, b) values (:a, :b)';
execute immediate v_string using v_a, v_b;
Re: executing a string in oracle...... [message #2002 is a reply to message #1944] Sat, 15 June 2002 19:44 Go to previous message
mani
Messages: 105
Registered: September 1999
Senior Member
hai thanks much....it workd fine......

mani
Previous Topic: last ten entries
Next Topic: Create Table if not Exists.
Goto Forum:
  


Current Time: Mon May 20 12:46:36 CDT 2024