spicysudhi
Programmer
Hi
I want to update a table (in PL/SQL) based on the value in the variable WEEK_NO. In a lengthy statement my line look like this
IF WEEK_NO = 1 THEN
UPDATE TABLE myTable Set WEEK1_QTY = xQty WHERE <condition>;
ELSIF WEEK_NO=2 THEN
UPDATE TABLE myTable Set WEEK2_QTY = xQty WHERE <condition>;
ELSIF WEEK_NO=3 THEN
UPDATE TABLE myTable Set WEEK3_QTY = xQty WHERE <condition>;
ELSIF WEEK_NO=4 THEN
UPDATE TABLE myTable Set WEEK4_QTY = xQty WHERE <condition>;
END IF;
Can someone help me in writing one single line to dynamically generate update statement.
thanks in advance.
Sudhi
I want to update a table (in PL/SQL) based on the value in the variable WEEK_NO. In a lengthy statement my line look like this
IF WEEK_NO = 1 THEN
UPDATE TABLE myTable Set WEEK1_QTY = xQty WHERE <condition>;
ELSIF WEEK_NO=2 THEN
UPDATE TABLE myTable Set WEEK2_QTY = xQty WHERE <condition>;
ELSIF WEEK_NO=3 THEN
UPDATE TABLE myTable Set WEEK3_QTY = xQty WHERE <condition>;
ELSIF WEEK_NO=4 THEN
UPDATE TABLE myTable Set WEEK4_QTY = xQty WHERE <condition>;
END IF;
Can someone help me in writing one single line to dynamically generate update statement.
thanks in advance.
Sudhi