aiaiDBA

加微信获取免费职业规划+学习资料,了解年薪50万的DBA是如何练成的

13718043309

010-86462881

PLS-00314: TABLE declarations are not allowed as PL/SQL local variables

PLS-00314: TABLE declarations are not allowed as PL/SQL local variables
Cause: In a precompiled program, the DECLARE TABLE statement was mistakenly used inside an embedded PL/SQL block. If an embedded PL/SQL block refers to a database table that does not yet exist, use the DECLARE TABLE statement to tell the precompiler what the table will look like. However, DECLARE TABLE statements are allowed only in the host program.
Action: Move the DECLARE TABLE statement outside the embedded PL/SQL block. If you want a variable that can store an entire row of data selected from a database table or fetched from a cursor or cursor variable, use the %ROWTYPE attribute.

请先 登录 后评论

1 个回答

小智
PLS-00314:TABLE声明不允许作为PL / SQL局部变量,
.原因:在预编译程序中,DECLARE TABLE语句在嵌入式PL / SQL块中被错误地使用。如果嵌入式PL / SQL块引用了尚不存在的数据库表,请使用DECLARE TABLE语句来告诉预编译器该表的外观。但是,DECLARE TABLE语句只允许在主机程序中使用。,
.操作:将DECLARE TABLE语句移到嵌入式PL / SQL块之外。如果您想要一个可以存储从数据库表中选择或从游标或游标变量获取的整行数据的变量,请使用%ROWTYPE属性。,
.
请先 登录 后评论