问题
Is there any way to update part of a user-defined type in Oracle?
Example:
create or replace TYPE MY_TYPE AS OBJECT
(
VAR_1 NUMBER,
VAR_2 DATE,
VAR_3 NUMBER,
VAR_4 DATE
);
Sample Table:
create TABLE TEST_TABLE
(
TBL_ID NUMBER,
MY_DATA MY_TYPE
);
Is there any way to do something like the following:
UPDATE TEST_TABLE SET MY_DATA.VAR_3 = 1;
Thanks!
回答1:
Yes but for some reason you need to alias the table:
UPDATE TEST_TABLE T SET T.MY_DATA.VAR_3 = 1;
来源:https://stackoverflow.com/questions/4677223/updating-user-defined-types-in-oracle-11g