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?
3821
November 04, 2005 01:40AM
2839
November 04, 2005 03:51AM
2582
November 04, 2005 06:46AM
2876
November 04, 2005 08:51AM
2553
November 23, 2005 10:50AM
2506
November 23, 2005 02:18PM
2581
November 04, 2005 08:54AM
2635
November 04, 2005 10:06AM
7086
November 04, 2005 03:40PM
2643
November 04, 2005 05:21PM
2710
November 04, 2005 04:45PM