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

Passing Dynamic variable to DB2


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed May 27, 2009 4:01 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed May 27, 2009 5:23 pm
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 !)
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 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 Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts JCL Dynamic System Symbols JCL & VSAM 3
Search our Forums:

Back to Top