Hi,
I have a cursor that produces a large amount of data with the below metadata -

Code:
KEY_COL	TGT_COL	TGT_VAL
The objective is to produce a dynamic update statement like this -
Code:
UPDATE ABC_TABLE
SET TGT_COL=TGT_VAL
WHERE Key=KEY_COL;
The TGT_COL could be any of the 50 columns in the ABC_TABLE.

Currently, I'm looping through the cursor -

Code:
FOR i IN cur_Dynamic
LOOP
vSql:='UPDATE ABC_TABLE SET '||i.TGT_COL||'='||CHR(39)||i.TGT_VAL||CHR(39)||' WHERE Key='||i.KEY_COL;
EXECUTE IMMEDIATE vSql;
END LOOP;
But this is taking a very long time to execute. Is there a way I can better code this to make it run faster?