【发布时间】:2021-07-31 02:19:29
【问题描述】:
当我在 Oracle 19c 中运行此代码时:
CREATE TYPE t_my_type IS TABLE OF my_table.my_col%TYPE;
我有这个错误:
Type t_my_type compiled
LINE/COL ERROR
--------- -------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
1/23 PLS-00201: identifier 'my_table.my_col' must be declared
Errors: check compiler log
为什么说必须声明?
【问题讨论】:
-
您只能在 pl/sql 对象中使用 %type 和 %rowtype。因此,您可以在 plsql 包中定义您的类型,例如
标签: sql oracle types oracle19c