IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dynamic Sql - table name is variable


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top