Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us