WEB开发网
开发学院数据库Oracle Oracle概念:异常和游标 阅读

Oracle概念:异常和游标

 2009-06-09 13:15:38 来源:WEB开发网   
核心提示: when l_exc then…end;/PRAGMA EXCEPTION_INITDeclareL_update_text varchar2(100):=‘update &table_name set &updated_column_name= ‘&

when l_exc then

end;

/

PRAGMA EXCEPTION_INIT

Declare

L_update_text varchar2(100):=

‘update &table_name set &updated_column_name= ‘’:a’’

where &key_column_name=:a’;

begin

execute immediate L_update_text using ‘&updated_column_value’, &key_column_value;

end;

/

Declare

Invalid_column_name exception;

Pragma exception_init(Invalid_column_name,-904);

L_update_text varchar2(100):=

‘update &table_name set &updated_column_name= ‘’:a’’

where &key_column_name=:a’;

begin

execute immediate L_update_text using ‘&updated_column_value’, &key_column_value;

exception

when Invalid_column_name then

dbms_output.put_line(‘hehe’);

end;

/

异常传播:

begin

begin

begin

begin

begin

declare

fname employees.first_name%type;

begin

select first_name into fname from employees where 1=2;

--exception

--when NO_DATA_FOUND then

-- dbms_output.put_line(‘block 6’);

end;

exception

when NO_DATA_FOUND then

dbms_output.put_line(‘block 5’);

end;

exception

when NO_DATA_FOUND then

上一页  1 2 3 4 5 6  下一页

Tags:Oracle 概念 异常

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接