(m_bgbh in varchar2)
AS
qhsm number(7,2);
hsm number(7,2);
shsm number(7,2);
jhsm number(7,2);
qzsm number(7,2);
zsm number(7,2);
zhsm number(7,2);
heism number(7,2);
yysd1m number(7,2);
yysd2m number(7,2);
v_cwmc varchar2(7);
v_yxms varchar2(60);
v_bz varchar2(100);
v_count number(7,2);
v_jh varchar2(20);
v_yylb varchar2(10);
v_csrq date;
TI number(7,2);
v_TI varchar2(10);
m_ypph number(7,2);
m_yybh varchar2(20);
CURSOR c1 IS select YPPH,YYBH from BFHSYSZSYS where BGBH=m_bgbh;
begin
OPEN c1;
LOOP
FETCH c1 into m_ypph,m_yybh;
EXIT WHEN c1%NOTFOUND;
.........
其它不变
AS
qhsm number(7,2);
hsm number(7,2);
shsm number(7,2);
jhsm number(7,2);
qzsm number(7,2);
zsm number(7,2);
zhsm number(7,2);
heism number(7,2);
yysd1m number(7,2);
yysd2m number(7,2);
v_cwmc varchar2(7);
v_yxms varchar2(60);
v_bz varchar2(100);
v_count number(7,2);
v_jh varchar2(20);
v_yylb varchar2(10);
v_csrq date;
TI number(7,2);
v_TI varchar2(10);
m_ypph number(7,2);
m_yybh varchar2(20);
CURSOR c1 IS select YPPH,YYBH from BFHSYSZSYS where BGBH=m_bgbh;
begin
OPEN c1;
LOOP
FETCH c1 into m_ypph,m_yybh;
EXIT WHEN c1%NOTFOUND;
.........
其它不变
解决方案 »
- oracle表存在重复值不插入数据问题
- 求高手告诉怎么正确导入dmp,我用imp导入的时候有错误提示
- 为什么使用pl/sql developer 和使用sql*plus得到的结果不同呢
- 求一个sql
- 关于 ORACEL 数据集的问题。。急~~
- Oracle10G GroupBy之后不会自动排序,有没有什么常量之类的能设置成自动排序?
- 存储过程里可以使用多线程吗????????????
- 在ORACAL里怎么使用存储过程输出结果集
- ORCALE死了?
- 怎么把数据库中以前的建表的语句导出来?
- 为什么我的数据插不进啊
- 请问为何在sql*plus下用create table命令建表后在OEM或OMS看不到,我用了commit提交过了,而在sql*plus worksheet中就可以?
DECLARE
-- Declare variables to hold information about the students
-- majoring in History.
v_StudentID students.id%TYPE;
v_FirstName students.first_name%TYPE;
v_LastName students.last_name%TYPE; -- Cursor to retrieve the information about History students
CURSOR c_HistoryStudents IS
SELECT id, first_name, last_name
FROM students
WHERE major = 'History';
BEGIN
-- Open the cursor and initialize the active set
OPEN c_HistoryStudents;
LOOP
-- Retrieve information for the next student
FETCH c_HistoryStudents INTO v_StudentID, v_FirstName, v_LastName; -- Exit loop when there are no more rows to fetch
EXIT WHEN c_HistoryStudents%NOTFOUND; -- Process the fetched rows. In this case sign up each
-- student for History 301 by inserting them into the
-- registered_students table. Record the first and last
-- names in temp_table as well.
INSERT INTO registered_students (student_id, department, course)
VALUES (v_StudentID, 'HIS', 301); INSERT INTO temp_table (num_col, char_col)
VALUES (v_StudentID, v_FirstName || ' ' || v_LastName); END LOOP; -- Free resources used by the cursor
CLOSE c_HistoryStudents; -- Commit our work
COMMIT;
END;
/
if qhsm is null then
Update BFHSYSZSYS set QHS=0 where BGBH=m_bgbh and YPPH=m_ypph and YYBH=m_yybh;
end if;
if hsm is null then
Update BFHSYSZSYS set HS=0 where BGBH=m_bgbh and YPPH=m_ypph and YYBH=m_yybh;
end if;
.....
这样的语句有没有更简单的方法啊
为空就赋值为0..
谢谢....
Update BFHSYSZSYS set QHS=0 where BGBH=m_bgbh and YPPH=m_ypph and YYBH=m_yybh;
end if;
DECLARE
-- Declare variables to hold information about the students
-- majoring in History.
v_StudentID students.id%TYPE;
v_FirstName students.first_name%TYPE;
v_LastName students.last_name%TYPE; -- Cursor to retrieve the information about History students
CURSOR c_HistoryStudents IS
SELECT id, first_name, last_name
FROM students
WHERE major = 'History';
BEGIN for c in cHistoryStudents
loop
-- code ;
end loop; ...
...
end ;