Who Can Create a Package Body
The CREATE PACKAGE BODY
statement can be executed by:
-
The owner of the package
-
Users with the
ALTER ANY PACKAGE
privilege
The CREATE PACKAGE BODY
statement can be executed by:
The owner of the package
Users with the ALTER ANY PACKAGE
privilege
CREATE PACKAGE BODY
CREATE PACKAGE BODY APP_VAR
AS
BEGIN
- Returns the start date of the period
FUNCTION GET_DATEBEGIN() RETURNS DATE DETERMINISTIC
AS
BEGIN
RETURN RDB$GET_CONTEXT('USER_SESSION', 'DATEBEGIN');
END
- Returns the end date of the period
FUNCTION GET_DATEEND() RETURNS DATE DETERMINISTIC
AS
BEGIN
RETURN RDB$GET_CONTEXT('USER_SESSION', 'DATEEND');
END
- Sets the date range of the working period
PROCEDURE SET_DATERANGE(ADATEBEGIN DATE, ADATEEND DATE)
AS
BEGIN
RDB$SET_CONTEXT('USER_SESSION', 'DATEBEGIN', ADATEBEGIN);
RDB$SET_CONTEXT('USER_SESSION', 'DATEEND', ADATEEND);
END
END
ALTER PACKAGE BODY
Alters a package body
DSQL
ALTER PACKAGE BODY name
AS
BEGIN
[ <package_item> ... ]
[ <package_body_item> ... ]
END
!! See syntax of CREATE PACKAGE BODY
for further rules !!
The ALTER PACKAGE BODY
statement modifies the package body.It can be used to change the definition and implementation of procedures and functions of the package body.
See [fblangref50-ddl-pkg-body-create] for more details.
The ALTER PACKAGE BODY
statement can be executed by:
The owner of the package
Users with the ALTER ANY PACKAGE
privilege
ALTER PACKAGE BODY
ALTER PACKAGE BODY APP_VAR
AS
BEGIN
- Returns the start date of the period
FUNCTION GET_DATEBEGIN() RETURNS DATE DETERMINISTIC
AS
BEGIN
RETURN RDB$GET_CONTEXT('USER_SESSION', 'DATEBEGIN');
END
- Returns the end date of the period
FUNCTION GET_DATEEND() RETURNS DATE DETERMINISTIC
AS
BEGIN
RETURN RDB$GET_CONTEXT('USER_SESSION', 'DATEEND');
END
- Sets the date range of the working period
PROCEDURE SET_DATERANGE(ADATEBEGIN DATE, ADATEEND DATE)
AS
BEGIN
RDB$SET_CONTEXT('USER_SESSION', 'DATEBEGIN', ADATEBEGIN);
RDB$SET_CONTEXT('USER_SESSION', 'DATEEND', ADATEEND);
END
END
DROP PACKAGE BODY
Drops a package body
DSQL
DROP PACKAGE package_name
Parameter | Description |
---|---|
package_name |
Package name |
The DROP PACKAGE BODY
statement deletes the package body.
The DROP PACKAGE BODY
statement can be executed by:
The owner of the package
Users with the ALTER ANY PACKAGE
privilege
DROP PACKAGE BODY
DROP PACKAGE BODY APP_VAR;
RECREATE PACKAGE BODY
Drops a package body if it exists, and creates a package body
DSQL
RECREATE PACKAGE BODY name
AS
BEGIN
[ <package_item> ... ]
[ <package_body_item> ... ]
END
!! See syntax of CREATE PACKAGE BODY
for further rules !!
The RECREATE PACKAGE BODY
statement creates a new or recreates an existing package body.If a package body with the same name already exists, the statement will try to drop it and then create a new package body.After recreating the package body, privileges of the package and its routines are preserved.
See [fblangref50-ddl-pkg-body-create] for more details.
RECREATE PACKAGE BODY
RECREATE PACKAGE BODY APP_VAR
AS
BEGIN
- Returns the start date of the period
FUNCTION GET_DATEBEGIN() RETURNS DATE DETERMINISTIC
AS
BEGIN
RETURN RDB$GET_CONTEXT('USER_SESSION', 'DATEBEGIN');
END
- Returns the end date of the period
FUNCTION GET_DATEEND() RETURNS DATE DETERMINISTIC
AS
BEGIN
RETURN RDB$GET_CONTEXT('USER_SESSION', 'DATEEND');
END
- Sets the date range of the working period
PROCEDURE SET_DATERANGE(ADATEBEGIN DATE, ADATEEND DATE)
AS
BEGIN
RDB$SET_CONTEXT('USER_SESSION', 'DATEBEGIN', ADATEBEGIN);
RDB$SET_CONTEXT('USER_SESSION', 'DATEEND', ADATEEND);
END
END