Database Error Messages

Release
toggle
  • 23ai
  • 21c
  • 19c
Updated
Jun 24, 2024

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.