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
 

 

Passing Dynamic variable to DB2

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

New User


Joined: 28 Nov 2007
Posts: 7
Location: chennai

PostPosted: Wed May 27, 2009 3:58 pm    Post subject: Passing Dynamic variable to DB2
Reply with quote

Hi,

I have a query i have a requirement like this,
in run time i have to give table name

its like this

EXEC SQL

SELECT colname from TNAME Where some condition

END-EXEC

The TNAME will be passed dymanically,is it possible can you please let me know your suggestions
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed May 27, 2009 4:01 pm    Post subject: Reply to: regarding DB2
Reply with quote

read the manual about dynamic sql
there is a link to the manuals at the top of the page
Back to top
View user's profile Send private message
karthikxan

New User


Joined: 28 Nov 2007
Posts: 7
Location: chennai

PostPosted: Wed May 27, 2009 5:18 pm    Post subject:
Reply with quote

Hi my question is

whether i can pass a table name dynamically into SQL statement

Regards
Karthik
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed May 27, 2009 5:23 pm    Post subject: Reply to: Passing Dynamic variable to DB2
Reply with quote

NO!
but You can use dynamic sql to build dynamically any query

at the top of the page there is a link to the manuals so that You can read about dynamic sql

edited to add a good reference ( thanks to expat !)
http://www.redbooks.ibm.com/redbooks/pdfs/sg246418.pdf
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 REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
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


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