Skip Headers
Oracle® TimesTen In-Memory Database SQL Reference
Release 11.2.1

Part Number E13070-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

CREATE PACKAGE

The CREATE PACKAGE statement creates the specification for a standalone package, which is an encapsulated collection of related procedures, functions, and other program objects stored together in your database. The package specification declares these objects. The package body defines these objects.

Required privilege

CREATE PROCEDURE (if owner) or CREATE ANY PROCEDURE (if not owner)

SQL syntax

CREATE [OR REPLACE] PACKAGE [Owner.]PackageName 
      [invoker_rights_clause] {IS|AS}
      plsql_package_spec

The syntax for the invoker_rights_clause:

AUTHID {CURRENT_USER | DEFINER}

Parameters

The CREATE PACKAGE statement has the parameters:

Parameter Description
OR REPLACE Specify OR REPLACE to recreate the package specification if it already exists. Use this clause to change the specification of an existing package without dropping and recreating the package. When you change a package specification, TimesTen recompiles it.
PackageName Name of the package.
invoker_rights_clause Lets you specify whether the package executes with the privileges and in the database of the user who owns it or with the privileges and in the database of the CURRENT_USER.

Specify CURRENT_USER to indicate that the package executes with the privileges of the CURRENT_USER.

Specify DEFINER to indicate that the package executes with the privileges of the owner of the database in which the package resides.

DEFINER is the default.

For more information, see Oracle Database SQL Language Reference.

IS|AS Specify either IS or AS to declare the body of the function.
plsql_package_spec Specifies the package specification. Can include type definitions, cursor declarations, variable declarations, constant declarations, exception declarations and PL/SQL subprogram declarations.

Description

The CREATE PACKAGE statement is not replicated.

When you create or replace a package, the privileges granted on the package remain the same. If you drop and re-create the object, the object privileges that were granted on the original object are revoked.

See also

Oracle Database PL/SQL Language Reference and Oracle Database SQL Language Reference