Skip to content

Commit

Permalink
[PlSql] Add pragma_declaration to package_obj_body (#3791)
Browse files Browse the repository at this point in the history
https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/SERIALLY_REUSABLE-pragma.html#GUID-35B02603-B794-403C-9E0D-E40208CEAF35 states that:
"The SERIALLY_REUSABLE pragma can appear in the declare_section of the specification of a bodiless package, or in both the specification and body of a package, but not in only the body of a package."
  • Loading branch information
marty-se authored Oct 22, 2023
1 parent b8e19fc commit a2ac92f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/plsql/PlSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@ function_spec
;

package_obj_body
: exception_declaration
: pragma_declaration
| exception_declaration
| subtype_declaration
| cursor_declaration
| variable_declaration
Expand Down
8 changes: 8 additions & 0 deletions sql/plsql/examples-sql-script/pragma_exception_init.pkb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
create or replace package body pragma_exception_init
is

some_exception exception;
pragma exception_init (some_exception, -20001);

end pragma_exception_init;
/

0 comments on commit a2ac92f

Please sign in to comment.