Hello.
Currently, it is possible to CREATE, ALTER, or RECREATE a PACKAGE
set autoterm;
CREATE PACKAGE TEST_PACKAGE
AS
BEGIN
FUNCTION DUMMY() RETURNS INT;
END;
CREATE OR ALTER PACKAGE TEST_PACKAGE
AS
BEGIN
FUNCTION DUMMY() RETURNS INT;
END;
ALTER PACKAGE TEST_PACKAGE
AS
BEGIN
FUNCTION DUMMY() RETURNS INT;
END;
RECREATE PACKAGE TEST_PACKAGE
AS
BEGIN
FUNCTION DUMMY() RETURNS INT;
END;
However, when it comes to a package body, some operations may fail:
set term ^;
ALTER PACKAGE BODY TEST_PACKAGE
AS
BEGIN
FUNCTION DUMMY() RETURNS INT
AS
BEGIN
RETURN 1;
END
END^
This is a really confusing error message. The problem is that the PACKAGE BODY does not support the ALTER or CREATE OR ALTER statements, yet the message references the package name, which can be misleading.
I think it is worth adding this parse rules to not confuse the users.
From my perspective, ALTER PACKAGE BODY is essentially equivalent to RECREATE statement, so I used the RECREATE node without changing the package code.
Hello. Currently, it is possible to CREATE, ALTER, or RECREATE a PACKAGE
However, when it comes to a package body, some operations may fail:
This results in the following error message:
This is a really confusing error message. The problem is that the PACKAGE BODY does not support the ALTER or CREATE OR ALTER statements, yet the message references the package name, which can be misleading.
I think it is worth adding this parse rules to not confuse the users. From my perspective, ALTER PACKAGE BODY is essentially equivalent to RECREATE statement, so I used the RECREATE node without changing the package code.