SQLCode:数据库操作的返回码,其中0--成功;-1--失败;100--没有检索到数据。[1]
例如,IFSQLCA.SQLCode<>0then
MessgeBox("连接失败","不能连接数据库")
RETURN
END IF
另外SQLCODE经常与SQLERRM连用
例如:
DBMS_OUTPUT.PUT_LINE(SQLCODE||'----'||SQLERRM);example:
create or replace procedure tes as
sqlc integer;
begin
insert into t1 values (1);
sqlc:=sqlcode;
if sqlc=0 then
dbms_output.put_line('成功!');
else
dbms_output.put_line('失败!');
end if;
end;