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

Senior Member


Joined: 14 Mar 2007
Posts: 10479
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

Senior Member


Joined: 14 Mar 2007
Posts: 10479
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
This topic is locked: you cannot edit posts or make replies. Need help - DB2 Dynamic SQL Program e... NikhilGuptaGaya DB2 6 Sat Jun 23, 2018 1:58 pm
No new posts Getting an error from EZASOKET while ... vaibhav gs COBOL Programming 5 Thu May 17, 2018 9:21 pm
No new posts java.io.FileNotFoundException - passi... Virendra Shambharkar Java & MQSeries 5 Mon Feb 26, 2018 11:41 am
No new posts Enterprise PL/I - dynamic allocation ... prino PL/I & Assembler 1 Mon Jan 29, 2018 10:17 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm

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