View previous topic :: View next topic
|
Author |
Message |
karthikxan
New User
Joined: 28 Nov 2007 Posts: 7 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
read the manual about dynamic sql
there is a link to the manuals at the top of the page |
|
Back to top |
|
|
karthikxan
New User
Joined: 28 Nov 2007 Posts: 7 Location: chennai
|
|
|
|
Hi my question is
whether i can pass a table name dynamically into SQL statement
Regards
Karthik |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|