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
 
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: 10309
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: 10309
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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm

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