您的位置:首页 > 数据库 > Oracle

oracle 中常用关键字解析

2013-01-07 10:16 232 查看
SQLCode:数据库操作的返回码,其中0--成功;-1--失败;100--没有检索到数据。[1]

  例如,IF SQLCA.SQLCode<>0 then

  MessgeBox("连接失败","不能连接数据库")

  RETURN

  END IF

  另外SQLCODE经常与SQLERRM连用

  例如:

  DBMS_OUTPUT.PUT_LINE(SQLCODE||'----'||SQLERRM);

例子

  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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: