Oracle游標的三種用法

2021-04-13 13:38:40 字數 524 閱讀 7221

迴圈游標

for record_index in cursor_name

loop

executable_statements

end loop;

普通游標

cursor cursor_name [(parameter [, parameter]...)]

[return return_type] is select_statements;

open cursor_name [(parameters)];

fetch cursor_name into variables;

close cursor_name;

可更新的游標

cursor cursor_name is

select_statement for update [of columns];

update table_name

set column_name=column_value

where current of cursor_name;

Oracle 動態游標的用法

oracle動態游標的簡單實現方法 下面就是例子程式 明細表列印予處理 通用報表 procedure mx print common pd id in mx pd syn.pd id type,p pd mxb id in mx pd mxb syn.p mxb id type,p dept no ...

詳解Oracle游標的簡易用法

下面看下oracle游標的簡易用法,具體 如下所示 create or replace procedure nw delyw ioperation id number,suserid varchar2 is scurdjbh yw operation link.djbh type cursor ta...

ORACLE游標的應用

在oracle資料庫中,可以使用游標瀏覽資料 更新資料和刪除資料,接下來列舉以幾個簡單的例子 通過使用游標既可以逐行檢索結果集中的記錄,又可以更新或刪除當前游標行的資料如果要通過游標更新或刪除資料,在定義游標時必須要帶有for update子句其語句格式如下 cursor cursor name i...