当前位置:网站首页>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;查询结果:

边栏推荐
- Show statement usage supplement
- 【图像增强】基于人工多重曝光融合AMEF实现图像去雾附matlab代码
- If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!
- Spark3.3.0源码编译补充篇-抓狂的证书问题
- Turris omnia: an open source router technology favored by hackers
- How to set MySQL triggers is a simple tutorial for novices
- Shell programming - user information management
- SQL 查询语句
- [digital signal processing] basic sequence (unit step sequence | relationship between unit step sequence and unit pulse sequence | rectangular sequence | relationship between rectangular sequence and
- Lightgbm-- parameter adjustment notes
猜你喜欢

MySQL

Differences, advantages and disadvantages between synchronous communication and asynchronous communication

遇到女司机业余开滴滴,日入500!

大厂面试TCP协议经典十五连问!22张图让你彻底弄明白
![[digital signal processing] basic sequence (unit step sequence | relationship between unit step sequence and unit pulse sequence | rectangular sequence | relationship between rectangular sequence and](/img/0c/3aeb7f93576181bbc46d2d1a1aa0e7.jpg)
[digital signal processing] basic sequence (unit step sequence | relationship between unit step sequence and unit pulse sequence | rectangular sequence | relationship between rectangular sequence and

分析 NFT 项目的 5 个指标

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

【元胞自动机】基于元胞自动机实现高速公路收费站交通流问题附matlab代码

STM32F1与STM32CubeIDE编程实例-热敏传感器驱动

Guide to "avoid dismissal during probation period"
随机推荐
SHOW语句用法补充
Decompile Android applications, interview Android
Global and Chinese silicon carbide monocrystal furnace market survey and future production and marketing demand analysis report 2022-2027
My SQL(二)
STM32F1与STM32CubeIDE编程实例-热敏传感器驱动
Shell编程-用户信息管理
Recognize pnpm: faster, higher performance NPM
【图像增强】基于人工多重曝光融合AMEF实现图像去雾附matlab代码
Installation and login of MySQL database
[image fusion] MRI-CT image fusion based on gradient energy, local energy and PCA fusion rules with matlab code
[digital signal processing] basic sequence (unit step sequence | relationship between unit step sequence and unit pulse sequence | rectangular sequence | relationship between rectangular sequence and
If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!
数据挖掘是什么?
How to publish function computing (FC) through cloud effect
Kotlin compose state recovery remembersaveable and remember
Market development status analysis and investment risk outlook report of China's battery industry 2022-2027
Bugku练习题---MISC---富强民主
[path planning] robot path planning based on improved artificial potential field with matlab code
分析 NFT 项目的 5 个指标
Spark3.3.0 source code compilation supplement - Crazy certificate problem