当前位置:网站首页>oracle创建带返回值的存储过程并sql执行调用
oracle创建带返回值的存储过程并sql执行调用
2022-06-26 06:59:00 【zengwenhe1987】
创建:
CREATE OR REPLACE PROCEDURE UpdateState (
v_ID IN NUMBER DEFAULT 0, v_Result VARCHAR2 DEFAULT NULL, --退回的原因
v_Code VARCHAR DEFAULT NULL, --退回的用户编码
pRecCur IN OUT sys_refcursor ) AS BEGIN
--INSERT into ZWH_TEST values('123','123','123','123','123','123',SYSDATE);
open pRecCur FOR SELECT
'1' res,
'成功'
FROM
dual;
END;调用:
Declare
Type Type_ROW is Record(
res varchar2(10),
res1 varchar2(15)
);
T_ROW Type_ROW;
type_cur sys_refcursor;
begin
UPDATESTATE(-1,'123','123',type_cur);
LOOP
FETCH type_cur INTO T_ROW;
EXIT WHEN type_cur%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('code:'||T_ROW.res||' name:'||T_ROW.res1||'' );
END LOOP;
CLOSE type_cur;
end;查询结果:

边栏推荐
- Numpy learning challenge level 5 - create array
- Guide to "avoid dismissal during probation period"
- SHOW语句用法补充
- Research Report on market supply and demand and strategy of Chinese amyl cinnamaldehyde (ACA) industry
- MySQL basic usage 01
- China polyphenylene oxide Market Development Prospect and Investment Strategy Research Report 2022-2027
- 淺析一道經典題
- DS18B20 details
- Screen sharing recommendations
- 面试官:测试计划和测试方案有什么区别?
猜你喜欢

Decision tree learning notes

DS18B20 details

cocoscreator播放Spine动画

If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!
![[path planning] robot path planning based on improved artificial potential field with matlab code](/img/82/b4cfb84de1cd56abe0c51205e99035.png)
[path planning] robot path planning based on improved artificial potential field with matlab code

. Net 20th anniversary! Microsoft sends a document to celebrate

【图像分割】基于最大主曲率实现视网膜眼底图像中的血管提取附matlab代码

Closure problem C Lua

I use flask to write the website "II"

LabVIEW arduino TCP / IP Remote Intelligent Home System (Project section - 5)
随机推荐
Rust中的过程宏
Procedure macros in rust
OCA安全联盟(CyberSecurity Mesh)
LabVIEW Arduino tcp/ip remote smart home system (project part-5)
shell 输入验证仅限字母数字
数据湖架构之Hudi编译篇
How to open an account in flush? Is it safe to open an account online?
Market scale forecast and investment risk forecast report of China's securities operating institutions 2022-2027
MYSQL(三)
Kotlin Compose 状态恢复 rememberSaveable 与 remember
同花顺究竟如何开户,网上开户是否安全么?
数据挖掘是什么?
[path planning] robot path planning based on improved artificial potential field with matlab code
Stm32f1 and stm32subeide programming example - thermal sensor driver
If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!
【路径规划】基于改进人工势场实现机器人路径规划附matlab代码
web入门之 Promise API
MySQL
Load balancer does not have available server for client: userservice problem solving
Temperature alarm