Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Dynamic Sql - table name is variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Jayalakshmi

New User


Joined: 02 Sep 2005
Posts: 26
Location: Hyderabad

PostPosted: Mon Sep 25, 2006 3:51 pm    Post subject: Dynamic Sql - table name is variable
Reply with quote

Hi all,

I want some sample code on how the below mentioned logic could be implemented:

The requirment is:

(1) Select col1,col2,col3 from table&date

Here, &date is variable.

(2) Suppose, I want to execute the above mentioned SQL 12 times by varying the value of &date as yymm i.e., 0503, 0504, ...0603

Any suggestions on how to implement this requirement?

Regards,
Jaya.
Back to top
View user's profile Send private message

anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Tue Sep 26, 2006 12:04 pm    Post subject:
Reply with quote

dynamic sql might help.

Anamika
Back to top
View user's profile Send private message
Muthukumar.PLindia

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Thu Sep 28, 2006 11:55 pm    Post subject:
Reply with quote

hi Anamika,
I find the statements for executing dynamic sql statements from cobol, using execute immediate command...
HOwever, could you brief aout how this program be compiled.. (i guess no need for binding in a plan)... and also explain abt runningg these programs
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us