Dynamic SQL. Is it possible?
I need to write an update SP that will take three (optionally nullable) parameters. The concept of nullable means I would not need to update the column affected by it. So, a call like CALL UPDATER(1, null, 3) would require an update to say, col1 and col3, but no change to col2. Using the concept of dynamic SQL that I've worked with in DB2 I could, based on the parameters I'm given, build a varchar string containing the runtime SQL to be executed. Something on the lines of:
UPDATE TABLEX SET COL1=PAR1, COL3=PAR3...
...or...
UPDATE TABLEX SET COL2=PAR2, COL3=PAR3...
If I create this varchar string then is it possible to run it as SQL?
I don't know if that is possible, but any advice will be appreciated.
Thanks.
Subject
Views
Written By
Posted
Dynamic SQL. Is it possible?
3501
November 04, 2005 01:40AM
2668
November 04, 2005 03:51AM
2423
November 04, 2005 06:46AM
2699
November 04, 2005 08:51AM
2416
November 23, 2005 10:50AM
2369
November 23, 2005 02:18PM
2443
November 04, 2005 08:54AM
2455
November 04, 2005 10:06AM
6679
November 04, 2005 03:40PM
2497
November 04, 2005 05:21PM
2551
November 04, 2005 04:45PM