Columns referenced by name in other columns.
From: F. Carlos Andr�s <fandres_at_polar.es>
Date: 22 Oct 2002 08:27:41 -0700
Message-ID: <3e5abb2f.0210220727.1f4aa755_at_posting.google.com>
)
) Up to 40 columns.
Date: 22 Oct 2002 08:27:41 -0700
Message-ID: <3e5abb2f.0210220727.1f4aa755_at_posting.google.com>
It's something like this:
TABLE1(
ID NUMBER, COLUMN VARCHAR2(32), VALUE NUMBER (10, 2)
)
TABLE2(
ID NUMBER, PRICE NUMBER (10, 2), VAT NUMBER (10, 2),
.
.
.
) Up to 40 columns.
In TABLE1 I've a register: ID=10, COLUMN='PRICE', VALUE=10.00. That
means that I've to change the value of the column PRICE in TABLE2 to
10.00 where ID=10.
I know that I van do this witn a cursor, inserting the values of
TABLE1 in variables vID, vCOLUMN, vValue, and with the conditionals
if (vCOLUMN = 'PRICE') update TABLE2 set PRICE = vVALUE where ID = vID; else if (........
And my question is if I can do that without writting the conditions for all the columns, because TABLE2 can grown in number of columns and then I must add new conditions for the new columns.
Thanks.
Paco Received on Tue Oct 22 2002 - 17:27:41 CEST