oracle 儲存過程返回游標

2021-06-28 01:36:05 字數 715 閱讀 1996

**示例,很多時候我們需要返回結果集,這個時候,我們就可以返回游標的方式給別人呼叫

create or replace procedure getprocontactinfowithpropid

(prop_id in varchar2, outcursor out sys_refcursor)

isbegin

open outcursor

forselect

o.fname as "contact_name",

case when o.f*** = 'woman' then '小姐' else '先生' end as "n_desp",

o.fphonenumber as "p_contact_no",

case

when o.fphone1status ='main' then '主要'

when o.fphone1status ='secondary' then '次要'

when o.fphone1status ='error' then '錯號'

when o.fphone1status ='canceled' then '作廢'

when o.fphone1status ='dontdisturb' then '勿擾'

end as "cn_desp"

from t_test o

where o.fid=prop_id;

end;

Oracle儲存過程返回游標

oracle儲存過程返回游標 有倆種方法 一種是宣告系統游標,一種是宣告自定義游標,然後後面操作一樣,引數型別為 in out 或out 1 宣告個人系統游標.推薦 create or replace p temp procedure cur arg out sys refcursor 方法1 be...

Oracle儲存過程返回游標例項詳解

有倆種方法 一種是宣告系統游標,一種是宣告自定義游標,然後後面操作一樣,引數型別為 in out 或out 1 宣告個人系統游標.推薦 如下 create or replace p temp procedure cur arg out sys refcursor 方法1 begin open cur...

請問Oracle儲存過程如何返回游標?

有倆種方法 一種是宣告系統游標,一種是宣告自定義游標,然後後面操作一樣,引數型別為 in out 或out 1 宣告個人系統游標.推薦 create or replace p temp procedure cur arg out sys refcursor 方法1 begin open cur ar...