存储过程如下插入哦前10个人都正常,到插入第11人的时候patientno的值还是10,之后插入的就一直都是10了什么情况大家帮我看看,我看了两个小时了也没看出来哪里有问题CREATE OR REPLACE Procedure p_b_insertmz(scardno Varchar2,scheckno Varchar2,scheckname varchar2,shiscardno Varchar2,spatientname Varchar2,spatientsex Varchar2,spatientage Varchar2,
spatientid varchar2, sVoucherNo Varchar2,sfreetype Varchar2,sregistope Varchar2,drgistdate Date, ipatientautoid Out Number )
--将门诊病人加入排队
Is
maxorderi Number;
maxno Number;
icout Number;
chkflag varchar2(2);
Begin Select nvl(max(patientorder)+5,5 ) Into maxorderi From t_b_patient Where to_char(patienttime,'yyyymmdd')=to_char(Sysdate,'yyyymmdd');
Select nvl(Max(patientno)+1,1) Into maxno From t_b_patient Where to_char(patienttime,'yyyymmdd')=to_char(Sysdate,'yyyymmdd') And checkno=scheckno ;
Select Count(*) Into icout from t_b_checkkind Where checkno=scheckno;
chkflag:='A';
If icout>0 Then
Select nvl(checkflg,'A') Into chkflag from t_b_checkkind Where checkno=scheckno;
End If; Select s_b_patient.nextval Into ipatientautoid From dual; Insert Into t_b_patient(autoid,cardno,hiscardno,patientid,patientno,patientname,patientsex,patientage,registtime,feetype,voucherno,rigistdate,
registope, ispre,isinvalid,checkname,patientstatus,patienttime,patientprior,patientorder,checkno,checkflag)
Values(ipatientautoid,scardno,shiscardno,spatientid,maxno,spatientname,spatientsex,spatientage,sysdate,sfreetype,svoucherno,drgistdate,
sregistope,0,0,scheckname,1,sysdate,'D-普通',maxorderi,scheckno,chkflag);
Commit;End p_b_insertmz;
spatientid varchar2, sVoucherNo Varchar2,sfreetype Varchar2,sregistope Varchar2,drgistdate Date, ipatientautoid Out Number )
--将门诊病人加入排队
Is
maxorderi Number;
maxno Number;
icout Number;
chkflag varchar2(2);
Begin Select nvl(max(patientorder)+5,5 ) Into maxorderi From t_b_patient Where to_char(patienttime,'yyyymmdd')=to_char(Sysdate,'yyyymmdd');
Select nvl(Max(patientno)+1,1) Into maxno From t_b_patient Where to_char(patienttime,'yyyymmdd')=to_char(Sysdate,'yyyymmdd') And checkno=scheckno ;
Select Count(*) Into icout from t_b_checkkind Where checkno=scheckno;
chkflag:='A';
If icout>0 Then
Select nvl(checkflg,'A') Into chkflag from t_b_checkkind Where checkno=scheckno;
End If; Select s_b_patient.nextval Into ipatientautoid From dual; Insert Into t_b_patient(autoid,cardno,hiscardno,patientid,patientno,patientname,patientsex,patientage,registtime,feetype,voucherno,rigistdate,
registope, ispre,isinvalid,checkname,patientstatus,patienttime,patientprior,patientorder,checkno,checkflag)
Values(ipatientautoid,scardno,shiscardno,spatientid,maxno,spatientname,spatientsex,spatientage,sysdate,sfreetype,svoucherno,drgistdate,
sregistope,0,0,scheckname,1,sysdate,'D-普通',maxorderi,scheckno,chkflag);
Commit;End p_b_insertmz;
解决方案 »
- 关于SQL语句OR的问题
- oracle的客户端
- 跳出存储过程的方法
- 请教怎样修复一个几百G的图像分区表的其中一个分区的数据文件上的坏块?????????在线等待!!!!!!!!!!!!!!
- 求教,10g中我开启了归档模式,但并未更改归档日志目标位置,那么默认的文件存档位置在哪,在oem中有10个位置的空格,在最后一行有默认的
- 能返回一多条记录吗?
- linux 9.0下oracle 9i的安装?在线等急用
- ********如何在oracle判断一个变量是否为整形(number)?~********
- 不评测,只调查!请实事求是的回答:贵公司关键业务所使用的数据库是什么?
- 关于一个oracle应用比较个性的架构
- 怎么在ORACLE 上创建一个用户 权限要求:只有创建用户 删除用户的权限,没有其他权限
- asp.net 中更新oracle数据 无效。。。
插入11条数据,返回11条记录啊 不过第11条记录的PATIENTNO = 10我手机上网太慢了,回复大家晚,都别跑啊!
从代码看,应该是没问题的