diff --git a/CN/modules/ROOT/pages/7.12.adoc b/CN/modules/ROOT/pages/7.12.adoc index 19b55d99..ff23cf83 100644 --- a/CN/modules/ROOT/pages/7.12.adoc +++ b/CN/modules/ROOT/pages/7.12.adoc @@ -19,23 +19,23 @@ IvorySQL提供了兼容Oracle自定义包的功能,包括包和包体的创建 使用CREATE OR REPLACE PACKAGE语句创建或替换一个包的规范。包是相关的存储过程、函数、和其他程序对象的集合,在数据库中作为一个单元存储。包规范声明这些对象,在包体中定义这些对象。 -在自己的模式下创建或替换一个包规范,必须有CREATE PROCEDURE系统权限,如果在其他用户的模式下创建或替换一个包,则需要有CREATE ANY PROCEDURE系统权限。 +创建包规范需要目标模式的 `CREATE` 权限以及 `plisql` 语言的 `USAGE` 权限。替换已有规范还需要包所有者的权限。超级用户可以执行这些操作。 === 创建包体 -使用CREATE OR REPLACE PACKAGE BODY语句创建或替换一个包体。创建包体需要有与创建包规范一样的权限,要求包体与包规范在同一个模式下,且包规范必须存在,该语句定义包规范中声明的对象。 +CREATE OR REPLACE PACKAGE BODY 创建或替换包规范中声明的对象定义。执行时需要目标模式的 `CREATE` 权限,且该模式中已经存在包规范。替换已有包体还需要包所有者的权限。超级用户可以执行这些操作。 当包规范中有cursor或子过程时,那么必须拥有一个包体去定义它,否则包体是可选的。 === 更新包 -使用ALTER PACKAGE语句来改变包的属性。执行ALTER PACKAGE语句的权限要求:必须是包的所有者,或者具有ALTER ANY PROCEDURE权限才能修改其他用户的包。 +ALTER PACKAGE 用于修改包的属性,需要包所有者的权限或超级用户权限。 === 删除包和包体 DROP PACKAGE语句删除数据库中的一个存储包。这个语句会同时删除包体和包规范。DROP PACKAGE BODY则只删除包体。 -不能使用此语句删除包中的一个单独对象。权限要求:包必须在用户模式下,或用户有DROP ANY PROCEDURE系统权限。 +`DROP PACKAGE` 需要包所有者、模式所有者或超级用户的权限。`DROP PACKAGE BODY` 需要所属包的所有者权限或超级用户权限。 === 丢弃包 diff --git a/EN/modules/ROOT/pages/7.12.adoc b/EN/modules/ROOT/pages/7.12.adoc index 63ead82f..59bb3490 100644 --- a/EN/modules/ROOT/pages/7.12.adoc +++ b/EN/modules/ROOT/pages/7.12.adoc @@ -19,23 +19,23 @@ IvorySQL provides compatibility for Oracle custom packages, including creation, The CREATE OR REPLACE PACKAGE statement is used to create or replace the specification of a package. A package is a collection of related stored procedures, functions, and other program objects, stored as a single unit in the database. The package specification declares these objects, and the package body defines them. -To create or replace the specification of a package in your own schema, you must have the CREATE PROCEDURE system privilege. If you are creating or replacing a package in another user's schema, you need the CREATE ANY PROCEDURE system privilege. +Creating a package specification requires `CREATE` on the target schema and `USAGE` on the `plisql` language. Replacing an existing specification also requires the privileges of the package owner. Superusers can perform these operations. === Create package body -The CREATE OR REPLACE PACKAGE BODY statement is used to create or replace a package body. To create a package body requires the same privileges as creating the specification of a package, and it is required that the package body and package specification be in the same schema, with the package specification already existing. This statement defines the objects declared in the package specification. +The CREATE OR REPLACE PACKAGE BODY statement creates or replaces the definitions declared by a package specification. It requires `CREATE` on the target schema and an existing specification in that schema. Replacing an existing body also requires the privileges of the package owner. Superusers can perform these operations. When the package specification contains cursors or subprograms, a package body must be present to define them. Otherwise, the package body is optional. === Alter package -The ALTER PACKAGE statement is used to modify the properties of a package.The privileges required to execute the ALTER PACKAGE statement are: you must be the owner of the package or have the ALTER ANY PROCEDURE privilege to modify packages owned by other users. +The ALTER PACKAGE statement modifies package properties and requires the privileges of the package owner, or superuser privileges. === Drop package and package body The DROP PACKAGE statement deletes a package in the database. This statement will remove both the package body and the package specification.The DROP PACKAGE BODY statement only deletes the package body. -It is not possible to delete a single object within the package using this statement. The privileges required:the package must be in the user's schema, or the user must have the DROP ANY PROCEDURE system privilege. +`DROP PACKAGE` requires the privileges of the package owner or the schema owner, or superuser privileges. `DROP PACKAGE BODY` requires the privileges of the owning package's owner, or superuser privileges. === DISCARD PACKAGE