Home » Developer & Programmer » Forms » Forms_ddl insertion problem (Oracle9i database,Oracle6i Developer Suite)
Forms_ddl insertion problem [message #413286] Wed, 15 July 2009 02:16 Go to next message
jolly_makkar
Messages: 63
Registered: March 2008
Member
Quote:
declare
cursor c1 is select internal_no from rec_start_letter where envelope_no=:control.env_no;
v_no varchar2(40);
begin
forms_ddl('create table table2(internal_no varchar2(40))');
open c1;
loop
fetch c1 into v_no;
exit when c1%notfound;
forms_ddl('INSERT INTO TABLE2 VALUES('||V_no||')');
END LOOP;
CLOSE C1;
END;


It inserts the value in table with some strange value 3.84661....
if i changes forms_ddl insertion
Quote:
forms_ddl('INSERT INTO TABLE2 VALUES(V_no)');

then none of the data gets inserted.

I am not able to find where i am doing mistake..Any help will be worth .

Thanks
Re: Forms_ddl insertion problem [message #413321 is a reply to message #413286] Wed, 15 July 2009 04:08 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hello,

Try this :
forms_ddl('INSERT INTO TABLE2 VALUES('''||V_no||''')');


Re: Forms_ddl insertion problem [message #413332 is a reply to message #413286] Wed, 15 July 2009 04:39 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you're having problems with dynamic sql it's always a good idea to build up a string of the statement you plan to execute. You can then display that string with a message or an alert to see if you've got it right.

I'd also strongly recommend not creating tables dynamically - it's almost never necessary.
Re: Forms_ddl insertion problem [message #413333 is a reply to message #413286] Wed, 15 July 2009 04:43 Go to previous message
jolly_makkar
Messages: 63
Registered: March 2008
Member
Thanks a Ton Tony ...It worked....!!!!
Previous Topic: create a menu
Next Topic: Updating too many records
Goto Forum:
  


Current Time: Wed Dec 07 22:02:08 CST 2016

Total time taken to generate the page: 0.08656 seconds