oracle 存储过程 for (多个循环语句调用)
来源:互联网 发布:360安全认证软件 编辑:程序博客网 时间:2024/05/21 12:50
在网上找了很多代码都是有问题的,所以自己记下自己写的代码,用于下次要用的时候直接复制过来调用,大家如果要用的话可以把模板拷贝过去,然后修改具体里面的细节
create or replace procedure deleteRepeatChoiceCourseData
asuser_id varchar2(100);
seme_course_id varchar2(100);
/************选课的游标************/
cursor choiceCourseCursor is
select user_id,seme_cour_id from t_teach_choice_course
group by user_id,seme_cour_id having count(1) >1;
/*********缴费的游标********/
cursor fiPaymentRecordCursor is
select charge_item_id,student_id,course_seme_id from t_fi_payment_record
group by charge_item_id,student_id,course_seme_id having count(1) > 1;
/**********成绩的游标***************/
cursor resultCursor is
select user_id,seme_cour_id from t_teach_result
group by user_id,seme_cour_id having count(1) >1;
begin
/*****************循环执行选课表t_teach_choice_course 的重复数据start *********/
dbms_output.put_line('************delete t_teach_choice_course data start***********');
for choiceCourseTemp in choiceCourseCursor loop
dbms_output.put_line(choiceCourseTemp.user_id||'**'||choiceCourseTemp.seme_cour_id);
end loop;
dbms_output.put_line('************delete t_teach_choice_course data start***********');
/*****************循环执行缴费表 t_fi_payment_record 的重复数据start *********/
dbms_output.put_line('************delete t_fi_payment_record data start***********');
for fiPaymentRecordTemp in fiPaymentRecordCursor loop
dbms_output.put_line(fiPaymentRecordTemp.student_id||'**'||fiPaymentRecordTemp.course_seme_id);
end loop;
dbms_output.put_line('************delete t_fi_payment_record data start***********');
/*****************循环执行缴费表 t_fi_payment_record 的重复数据end***********/
/*****************循环执行成绩表 t_teach_result 里面的重复数据start *********/
dbms_output.put_line('************delete t_teach_results data start***********');
for resultTemp in resultCursor loop
dbms_output.put_line(resultCursor.user_id||'**'||resultCursor.seme_cour_id);
end loop;
dbms_output.put_line('************delete t_teach_results data start***********');
/*****************循环执行成绩表 t_teach_results 里面的重复数据end***********/
end deleteRepeatChoiceCourseData;
0 0
- oracle 存储过程 for (多个循环语句调用)
- oracle利用数组循环调用多个存储过程
- Oracle 循环调用存储过程
- oracle 存储过程循环执行update语句
- Oracle 存储过程中的循环语句写法
- oracle存储过程、声明变量、for循环
- oracle存储过程、声明变量、for循环
- oracle存储过程、声明变量、for循环
- oracle存储过程、声明变量、for循环
- oracle存储过程、声明变量、for循环
- oracle存储过程、声明变量、for循环
- Oracle使用游标循环调用存储过程
- .net 调用oracle存储过程返回多个记录集
- ASP.NET调用oracle存储过程返回多个游标
- java调用oracle存储过程 返回多个结果集
- Java调用oracle存储过程返回多个结果集
- Oracle 实现多个存储过程顺序调用执行
- oracle存储过程循环
- 手写代码往最初的工程添加UINavigationController
- android 二级菜单的实现
- 使用Autolayout xib实现动态高度的TableViewCell
- POJ 3254 Corn Fields DP 状态压缩 入门
- Python-自定义异常
- oracle 存储过程 for (多个循环语句调用)
- HDU 2830 Matrix Swapping II
- 使用GitHub + Hexo搭建个人博客(一)- 安装
- 2015 百度一面
- 二分查找
- ubuntu 系统连接 xiaomi手机
- Linux C中读取/dev/input/event设备来判断键盘按键是否按下
- Extjs4.2边学边用之application()
- 计算机图形学笔记