View previous topic :: View next topic |
Author |
Message |
sharada Beginner
Joined: 24 Aug 2005 Posts: 32 Topics: 14 Location: Hyderabad
|
Posted: Mon Nov 20, 2006 3:30 am Post subject: Dynamic SQL |
|
|
HI,
is it possible to write dynamic sql queries?
moving the entire query into a variable and executing the query using the value in the variable.
Can anyone one of you hekp me? |
|
Back to top |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Mon Nov 20, 2006 5:13 am Post subject: |
|
|
Look at the source code of DSNTEP2. This source is part of the DB2 libraries (DSNSAMP, SAMPLIB, ???).
regards
Christian |
|
Back to top |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Tue Nov 21, 2006 4:54 am Post subject: |
|
|
Well, sharada,
using dynamic SQL is much more complicated. The reason is, that you have to allocate storage for the data fetched by your dynamic statement, and you don't know up front, what data types you will select.
regards
Christian |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue Nov 21, 2006 5:41 am Post subject: |
|
|
sharada what are you using? Cobol, Rexx, Syncsort ? |
|
Back to top |
|
|
|
|