300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > oracle修改字段名称 试图删除被依赖列_oracle 添加 删除列 修改表名字 ;加注释 异常解释...

oracle修改字段名称 试图删除被依赖列_oracle 添加 删除列 修改表名字 ;加注释 异常解释...

时间:2019-02-14 14:00:40

相关推荐

oracle修改字段名称 试图删除被依赖列_oracle 添加 删除列 修改表名字 ;加注释 异常解释...

desc xujin;

alter table xujin add 字段名 字段类型;

alter table xujin modify cloumn 列名字 列类型;修改列名 ,列类型

alter table xujin drop cloumn 列名字 删除;

rename oldtablename to newtablename;

comment on column xujin.nameis'name 的描述性语言';

sql隐式游标%found%notfound%isopen%rowcount

sql%found

insert update delte select into 有影响的记录 那么sql%founnd 则为ture;

sql%notfound

insert update delete select into 没有有影响的记录 那么sql%founnd 则为ture;%rowcount

insert update (select into 没有返回行是0) delete 所影响的记录

oracle 异常处理

begin

exception

when others then

when no_data_found then

when to_many_rows_then

end;

oracle 自定义异常

declare

exception_name exception;

begin

statmens;

raise exception_name ;

exception

when exception_name then

end;----无聊写一些小例子

也巩固下自己知识点----------------异常 自己定义的一场小例子/*declare

exception_name exception;

begin

raise exception_name;

exception

when exception_name then

dbms_output.put_line('aaaaaaaaa');

end;*/--输出多行/**declare

v_name varchar2(200);

begin

select name into v_name from xujin ;

exception

when too_many_rows then

dbms_output.put_line('aaaaaaaaaaaaaa');

end;*/--没有数据输出/**

declare

v_name varchar2(200);

begin

select name into v_name from xujin where name='xujin';

exception

when no_data_found then

dbms_output.put_line('aaaaaaaaaaaaaa');

end;**/---利用异常 输出

declare

v_name varchar2(200);

begin

update xujinsetname='a'whererownum=1;ifsql%rowcount>=1then

dbms_output.put_line('bbbbbbbb');gotolog;

endif;ifsql%notfound then

dbms_output.put_line('cccccccc');

endif;

dbms_output.put_line('cccccccc');<>dbms_output.put_line('eeeeeeeeeeeeeee');ifsql%found then

dbms_output.put_line('ddddddddddddd');

endif;

exception

when no_data_found then

dbms_output.put_line('aaaaaaaaaaaaaa');

dbms_output.put_line(sqlcode+sqlerrm);--oralce 存储过程异常代码

commit;

end;

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。