Updating User-defined types in Oracle 11G

杀马特。学长 韩版系。学妹 提交于 2020-03-26 05:26:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!