当前位置:网站首页>oracle存储过程问题解答
oracle存储过程问题解答
2022-08-09 07:36:00 【CSDN问答】
8、请阅读下面的存储过程:
/* Formatted on 2011/05/21 11:12 (Formatter Plus v4.8.7) */
DECLARE
out_msg VARCHAR2 (1000);
vcount INTEGER;
BEGIN
out_msg := '';
DECLARE
CURSOR cur_cust
IS
SELECT *
FROM base_customers;
cur_row cur_cust%ROWTYPE;
BEGIN
OPEN cur_cust;
LOOP
FETCH cur_cust
INTO cur_row;
EXIT WHEN cur_cust%NOTFOUND;
SELECT COUNT ()
INTO vcount
FROM rec_main_consume
WHERE customerid = cur_row.customerid;
insert into temp1(customerid,operno) values (cur_row.customerid,vcount);
if (SQL%ROWCOUNT>1)
then8、请阅读下面的存储过程:
/ Formatted on 2011/05/21 11:12 (Formatter Plus v4.8.7) */
DECLARE
out_msg VARCHAR2 (1000);
vcount INTEGER;
BEGIN
out_msg := '';
DECLARE
CURSOR cur_cust
IS
SELECT *
FROM base_customers;
cur_row cur_cust%ROWTYPE;
BEGIN
OPEN cur_cust;
LOOP
FETCH cur_cust
INTO cur_row;
EXIT WHEN cur_cust%NOTFOUND;
SELECT COUNT (*)
INTO vcount
FROM rec_main_consume
WHERE customerid = cur_row.customerid;
insert into temp1(customerid,operno) values (cur_row.customerid,vcount);
if (SQL%ROWCOUNT>1)
then
dbms_output.put_line(to_Char(SQL%ROWCOUNT));
end if;
END LOOP;
END;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
END;
认真阅读之后,请回答下面的问题。
1)请用自己的语言对此存储过程进行功能说明。
2)上述过程中 “ DECLARE
CURSOR cur_cust”
语句是什么用途以及含义?
3)上述过程运行结果什么?
边栏推荐
- Invoker 2019CCPC Qinhuangdao Station I Question Simple DP
- Codeforces Round #359 (Div. 2) C. Robbers' watch Violent Enumeration
- 虚拟机网卡报错:Bringing up interface eth0: Error: No suitable device found: no device found for connection
- 分布式事务产生的原因
- tianqf's problem-solving ideas
- Laravel文档阅读笔记-Rendering JSON(对JS变量进行赋值)
- EXCEL使用函数联调(find,mid,vlookup,xlookup)
- 排序第一节——插入排序(直接插入排序+希尔排序)(视频讲解26分钟)
- 【Template】Tree Chain Segmentation P3384
- 【ROS2原理8】节点到参与者的重映射
猜你喜欢
随机推荐
View log common commands
高德地图JS - 已知经纬度来获取街道、城市、详细地址等信息
【ROS2原理8】节点到参与者的重映射
MYSQLWorkbench看数据库ER图
postgresql Window Functions
JSONObject遍历的时候顺序不一致,导致数据对应出错
car-price-deeplearning-0411
接口测试概念
【烂笔头】各厂商手机手动抓log
重要消息丨.NET Core 3.1 将于今年12月13日结束支持
P1505 [National Training Team] Tourism Tree Chain Breakdown
Sklearn data preprocessing
4.MySQL更新和删除数据
一站制造项目及Spark核心面试 ,220808,,,
The maximum validity period of an SSL certificate is 13 months. Is it necessary to apply for multiple years at a time?
Important news丨.NET Core 3.1 will end support on December 13 this year
Invoker 2019CCPC秦皇岛站I题 简单DP
力扣208,实现Trie(前缀树)
分布式事务产生的原因
XILINX K7 FPGA+RK3399 PCIE驱动调试