| 这样的存储过程怎么写?请帮帮忙 | 点击:51 | 分类:Oracle 时间:2005-12-28 18:28:31 roseandwort收录  | | | 要求sql语句的文件名为变量,并且游标返回多行记录,下面存储过程怎么写 | | | CREATE OR REPLACE PROCEDURE PROC1(niandu in VARCHAR2, dh in VARCHAR2) is v_rec mytemptable%rowtype; v_file varchar2(50); strTemp varchar2(200); type hehecur is ref cursor; tempCursor hehecur; begin v_file := 'HH'||niandu; strTemp := ''; strTemp := 'select * From ' || v_file || ' Where dhhh=dh'; open tempCursor for strtemp; loop fetch tempCursor into v_rec; exit when tempCursor%notfound; insert into mytemptable values(v_rec.id, v_rec.des, v_rec.qty); commit; end loop; close tempCursor; END PROC1;
|
| | http://community.csdn.net/Expert/topic/4479/4479905.xml?temp=.4174768 | |
|
|
|