View previous topic :: View next topic
|
Author |
Message |
Karthikkumargk
New User
Joined: 28 Dec 2010 Posts: 2 Location: India
|
|
|
|
Hi ,
I have two questions regarding Dynamic SQL
1) Can Insert with Select be done with my Dynamic SQL?If so can you please help me in doing it
Example:
Insert Into tableb
values(from_acct_seq,to_acct_seq)
select from_acct_seq from acct_actv
Where
Date= current-date
2) Are there any performance implications |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Karthik,
Quote: |
1) Can Insert with Select be done with my Dynamic SQL?If so can you please help me in doing it
Example:
Insert Into tableb
values(from_acct_seq,to_acct_seq)
select from_acct_seq from acct_actv
Where
Date= current-date |
Yes. You can use SPUFI
Quote: |
2) Are there any performance implications |
It Depends( no. of row available on table & is there an index on the date column)
Welcome to IBMMAINFRAMES!
You have to be more elaborate...... the information you specified is not enough.
Why Dynamic SQL ?
Why do you think there will be some performance problem ?
Thanks,
Sushanth |
|
Back to top |
|
|
Karthikkumargk
New User
Joined: 28 Dec 2010 Posts: 2 Location: India
|
|
|
|
Hi Sushant,
Thru Spufi its is feasible.
Application requires Dynamic SQL.
My query is can we use that sort of insert in Dynamic SQL.If so can you provide some sample code for the above insert |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
If you can successfully code and execute your SQL thru SPUFI - then you should be able to prepare and execute that same SQL dynamically in an application program - assuming that you have sufficient authority to do so. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Karthik,
You can sample COBOL code for dynamic programming in DB2 V9 Application Programming & SQL Guide - Search for "Sample COBOL dynamic SQL program".
Thanks,
Sushanth |
|
Back to top |
|
|
|