Simply, the usages of ALTIBASE Stored Procedure(ALTIBASE PSM) has so many resemblances to those of ORACLE.
Whereas It has a few differences with ORACLE's one.
In summation, The differences between them are as follows.
"FETCH ACROSS COMMIT" and "STORED PACKAGE" functionalities will be adopted as new features at ALTIBASE HDB V7. |
LOB type variables cannot be declared in the declare section of a stored procedure.
Additionally, the %TYPE and %ROWTYPE attributes cannot be used to declare variables when the underlying column
in the actual database object is a LOB type column.
Because LOB type variables cannot be declared within stored procedures, data in LOB type columns
cannot be fetched using cursors.
Therefore, LOB type columns cannot be referenced using cursor
control statements.
Same as above, Geometry type is unusable in ALTIBASE Stored Procedure.
A user can not issue a commit or rollback statement with a cursor open.
ORACLE
CREATE OR REPLACE PROCEDURE cur_proc1 (in_val IN INTEGER, out_val OUT INTEGER) IS CURSOR cur1 IS SELECT c1 FROM t1 WHERE c1>in_val; col1 INTEGER; r1 INTEGER; BEGIN r1 := 0; OPEN cur1; LOOP FETCH cur1 into col1; EXIT WHEN cur1%NOTFOUND; INSERT INTO t2 VALUES(col1); COMMIT; -- 허용됨. r1 := r1+1; DBMS.PUT_LINE(col1); END LOOP; CLOSE cur1; DBMS.PUT_LINE('# of insert: '||r1); out_val := r1; END; / |
ALTIBASE HDB
CREATE OR REPLACE PROCEDURE cur_proc1 (in_val IN INTEGER, out_val OUT INTEGER) IS CURSOR cur1 IS SELECT c1 FROM t1 WHERE c1>in_val; col1 INTEGER; r1 INTEGER; BEGIN r1 := 0; OPEN cur1; LOOP FETCH cur1 into col1; EXIT WHEN cur1%NOTFOUND; INSERT INTO t2 VALUES(col1); COMMIT; (X) r1 := r1+1; PRINTLN(col1); END LOOP; CLOSE cur1; COMMIT; (O) PRINTLN('# of insert: '||r1); out_val := r1; END; / |
This functionality will be adopted in ALTIBASE HDB V7 as a new one. |
ALTIBASE HDB does not support Stored Package(called as a Package).
This functionality will be adopted in ALTIBASE HDB V7 as a new one as well. |
ORACLE |
ALTIBASE HDB |
Comments |
---|---|---|
create or replace procedure proc1(b1 integer, e1 integer) |
create or replace procedure proc1(b1 integer, e1 integer) |
Simple usage of ALTIBASE Stored Procedure and PL/SQ;. |
DECLARE |
CREATE OR REPLACE PROCEDURE PROC3( |
Associative Array(Nested Table) |