更改Oracle 12g中的类型 - 在完成更改后询问DDL输出

时间:2017-09-15 13:59:55

标签: sql oracle types

这是运行alter类型后TYPE的一个片段。我想知道最后一行(新属性)是否正确显示,或者是否需要另一个步骤来编译属性:

-- academic status code
ACADEMIC_STATUS_CODE VARCHAR2(2),

-- constructor
constructor function TESTTEST_TYPE return self as result,

-- function to keep versions sync'ed
member function fast_version return varchar2,

--member method to put everything to dbms_output
MEMBER PROCEDURE PRINT_TO_DBMS_OUT,

--member method to put everything to dbms_output
MEMBER PROCEDURE PRINT_TO_DBMS_OUT_HELPER(
      spaces_to_indent_in__ IN number, recursion_level_in__ IN number)

  ) INSTANTIABLE NOT FINAL
 alter type  testtest_type
    add attribute (STUDENT_PREFERRED_PRONOUN VARCHAR2(50)) cascade
/

1 个答案:

答案 0 :(得分:0)

您发出"更改类型"在类型定义之外的命令(你不要将它附加到类型本身的末尾)

alter type testtest_type add attribute (STUDENT_PREFERRED_PRONOUN VARCHAR2(50));

如果你的类型是FINAL而你需要它,那么NOT FINAL(对于子类型等)发出以下内容:

alter type testest_type not final cascade;