oracle 的一些處理

2021-08-31 06:32:24 字數 1049 閱讀 7356

1.oracle 自定義異常

v_exception exception; 定義異常變數

pragma exception_init(v_exception, -20001); 繫結異常

---處理異常資訊

exception when v_exception then

--處理邏輯

when others then

--處理邏輯

end;

2.oracle 動態游標

type i_curso_type is ref cursor; --動態游標型別

open v_cursor for p_sql;

loop

fetch v_cursor into v_polno,v_certno,v_account_type,v_account_code,v_tx_amount,v_tx_date;

exit when v_cursor%notfound;

--處理邏輯

end loop;

close v_cursor;

3.oracle 類似陣列的東西

type month_amount_type is record(year_month varchar(10), amount number);--月份與保單管理費對應關係

type month_amount_table_type is table of month_amount_type;--相當於月份與管理費對應關係數值

--使用

v_table:=month_amount_table_type();

v_table.extend;

v_param_ele.year_month:=p_year_month;

v_param_ele.amount:=0;

v_table(1):=v_param_ele;

--迴圈

for i in 1..p_month_amount_table.count loop

v_param_ele:=p_month_amount_table(i);

end loop;

Oracle中的一些時間處理

oracle 中的時間處理 1.select sysdate from dual。2.select sysdate from dual 3.select sysdate 0.041666687 from dual。4.得到當前年份 select to char sysdate,yyyy from d...

Oracle無法啟的一些處理方法總結

感謝李總的指點!現資料庫服務已可正常啟動!startup時,總報監聽無法識別主機名,推測肯定是 etc hosts檔案的問題,但檢查了hosts中的內容,沒有問題,困惑了很長時間,後來在李總的指導下,才發現是檔案許可權的問題,當用root服務編輯 hosts檔案後,該檔案的所有者就變為了root,此...

oracle的一些常見問題及處理

1.安裝後如果通過 regional and language options oracle服務將不能正常啟動,tns會出問題。2.安裝oracle不能通過dhcp分配ip,需要自己指定好ip才能安裝成功。3.oracle的安裝目錄不能是中文,否則安裝不成功。4.安裝時計算機名不能是中文,否則監聽不...