17,380
社区成员
发帖
与我相关
我的任务
分享create table test1 as select * from dual where 1=0;
/
CREATE OR REPLACE PROCEDURE pro_test (RESULT in OUT INT)
IS
BEGIN
INSERT INTO test1
VALUES (RESULT);
COMMIT;
RESULT := 1;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
RESULT := 0;
END;
/
set serverout on
declare
x number;
begin
x:=10;--设为1操作成功,返回1. 设为10操作失败,返回0
pro_test(x);
dbms_output.put_line(x);
end;
/