Showing posts with label PLS-00113. Show all posts
Showing posts with label PLS-00113. Show all posts

Tuesday, May 22, 2007

PLS-00113 END identifier ABC must match XYZ at line L, column C

Just a quick note for a fairly uncommon PL/SQL syntax error.
I say uncommon because i got this for the first time after nearly 10 years of developing PL/SQL programs!

Scenario:

PACKAGE "PKG_TEST"
as
function test_fn return integer;
end "TEST";
PLS-00113 END identifier 'TEST' must match 'PKG_TEST' at line 1, column 9
The syntax error message is very clear, i forgot to prepend PKG to the identifier after the closing END statement to make them equal and the parser is checking out the consistency of these strings.

Note that specifying the closing identifier is optional, normally is just there for enhancing program readability, therefore you could safely remove it if you want to.
PACKAGE "TEST"
as
function test_fn return integer;
end; -- no identifier

Identifier cross checking is performed between package, procedure and function names and their respective closing END statements.
PACKAGE BODY "TEST"
as
function "TEST_FN"
return integer
is
begin
begin
return 1;
end "sub-block";
end "TEST_FN";
end "TEST";
In green you can see a spare identifier for an END statement of a PL/SQL sub-block.

Note also that identifiers are case sensitive when enclosed between double quotes and are automatically considered as written in uppercase if not, so, the following unit will return a syntax error:
PACKAGE BODY "TEST"
as
function test_fn
return integer
is
begin
begin
return 1;
end "sub-block";
end "test_fn";
end "TEST";
PLS-00113 END identifier 'test_fn' must match 'TEST_FN' at line 3, column 12

In conclusion, if for some reason you need to rename a procedure, a function or a package, you will have to check out also any closing END statement identifiers in order to successfully compile the unit.

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles