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隱式游標(biāo)%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;----無聊寫一些小例子
也鞏固下自己知識(shí)點(diǎn)----------------異常 自己定義的一場(chǎng)小例子/*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;*/--沒有數(shù)據(jù)輸出/**
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 存儲(chǔ)過程異常代碼
commit;
end;
總結(jié)
以上是生活随笔為你收集整理的oracle修改字段名称 试图删除被依赖列_oracle 添加 删除列 修改表名字 ;加注释 异常解释...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python 下载图片损坏_爬虫爬取出的
- 下一篇: win7映射网络驱动器消失了_网络资源共