[英]Error PLS-00201 while trying to create table type in Oracle
當我在 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
為什么它說它必須聲明?
在這里找到答案: https://community.oracle.com/tech/developers/discussion/3582858/pls-00201-when-declaring-table-type
在這種情況下,您不能使用%TYPE
。 您必須使用一些預定義的 Oracle 類型,例如NUMBER
或創建一個集合。
例子:
CREATE TYPE t_my_type IS TABLE OF NUMBER;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.