AUTHID子句定义了一个过程的所有者权限,DEFINER(默认)表示定义者权限执行,或者用CURRENT_USER覆盖程序的默认行为,变为使用者权限 PRAGMA AUTONOMOUS_TRANSACTION:表示过程启动一个自治事务,自治事务可以让主事挂起,在过程中执行完SQL后,由用户处理提交或者回滚自治事务, 然后恢复主事务 EXECUTE 过程名 来调用过程 或者EXEC ...
An autonomous transaction can be defined in a stored procedure. The identifier of an autonomous transaction isPRAGMA AUTONOMOUS_TRANSACTION. The syntax of an autonomous transaction is the same as that of creating a stored procedure. For details, seeCREATE PROCEDURE. The following is an example: ...
PRAGMA AUTONOMOUS_TRANSACTIONPRAGMA AUTONOMOUS_TRANSACTION 是将存储过程设置为自治事务的指令。 说明 STRICT、LEAKPROOF、PARALLEL、COST、ROWS 和 SET 关键字可以为PolarDB PostgreSQL版(兼容Oracle)提供扩展功能,但 Oracle 不支持这些关键字。 只有PolarDB PostgreSQL版(兼容Oracle)存储过程支持 IMMUTABLE、STABLE、STRICT、LE...
pragma autonomous_transaction is begin update t_user set apple=apple where user_code=userCode; commit; end; / 授权其他用户访问procedure grant execute on addApple to chuyf; 用户chuyf访问:exec system.addApple(3,3);--作用于用户system的t_user表 create or replace procedure getApple (userCode in...
PROCEDUREname[(parameters)]{ IS | AS }[PRAGMAAUTONOMOUS_TRANSACTION;] [ declarations ]BEGINstatementsEND[name]; 参数 示例 以下示例是匿名块中的一个子存储过程。 DECLAREPROCEDURElist_empISv_empnoNUMBER(4); v_ename VARCHAR2(10);CURSOR emp_curISSELECTempno, enameFROMempORDERBYempno;BEGINOPEN emp_cur...
Autonomous TransactionSQL> SQL> create table t ( msg varchar2(4000) ); Table created. SQL> SQL> create or replace procedure auto_proc 2 as 3 pragma autonomous_transaction; 4 begin 5 insert into t values ( 'A row for you' ); 6 commit; 7 end; 8 / Procedure creat...
PRAGMA AUTONOMOUS_TRANSACTIONis the directive that sets the procedure as an autonomous transaction. Note TheSTRICT,LEAKPROOF,PARALLEL,COST,ROWSandSETkeywords provide extended functionality for Advanced Server and are not supported by Oracle. TheIMMUTABLE,STABLE,STRICT,LEAKPROOF,COST,ROWSandPARALLEL { UNSAFE...
PRAGMA AUTONOMOUS_TRANSACTION PRAGMA AUTONOMOUS_TRANSACTION 是將預存程序設定為自治事務的指令。 說明 STRICT、LEAKPROOF、PARALLEL、COST、ROWS 和 SET 關鍵字可以為PolarDB PostgreSQL版(相容Oracle)提供擴充功能,但 Oracle 不支援這些關鍵字。 只有PolarDB PostgreSQL版(相容Oracle)預存程序支援 IMMUTABLE、STABLE、STRICT...
[ EXTERNAL ] SECURITY DEFINER | AUTHID DEFINER | AUTHID CURRENT_USER | PARALLEL { UNSAFE | RESTRICTED | SAFE } | COST execution_cost | ROWS result_rows | SET configuration_parameter { TO value | = value | FROM CURRENT } ...] { IS | AS } [ PRAGMA AUTONOMOUS_TRANSACTION; ] [ ...
If you're using oracle you can make the Stored Procedure a Pragma Autonomous Transaction, that way you'll be able to INSERT and COMMIT independently from the original transaction issued from the PowerBuilder application. You must be a registered user to add a comment. If you've already regist...