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?
3460
November 04, 2005 01:40AM
2641
November 04, 2005 03:51AM
2402
November 04, 2005 06:46AM
2669
November 04, 2005 08:51AM
2398
November 23, 2005 10:50AM
2347
November 23, 2005 02:18PM
2427
November 04, 2005 08:54AM
2426
November 04, 2005 10:06AM
6603
November 04, 2005 03:40PM
2462
November 04, 2005 05:21PM
2531
November 04, 2005 04:45PM