S
smp
Unregistered / Unconfirmed
GUEST, unregistred user!
DB:ORACLE8
DELPHI3
我在SERVER端建立了如下的存储过程:
create function maxoftable(tablename IN CHAR)
RETURN NUMBER
IS
maxri NUMBER(10);
BEGIN
SELECT max_ri INTO maxri FROM rioftable WHERE table_name=tablename;
RETURN(maxri);
END;
create function minoftable(tablename IN CHAR)
RETURN NUMBER
IS
minri NUMBER(10);
BEGIN
SELECT min_ri INTO minri FROM rioftable WHERE table_name=tablename;
RETURN(minri);
END;
create or replace procedure insert_statofday(indate IN DATE,inok IN NUMBER,innok_user IN NUMBER,innok_data IN NUMBER,
innok_service IN NUMBER)
AS
inri NUMBER(10);
minri NUMBER(10);
BEGIN
IF (maxoftable('STATOFDAY')-minoftable('STATOFDAY'))>363 THEN
DELETE FROM STATOFDAY WHERE RI=minoftable('STATOFDAY');
inri:=maxoftable('STATOFDAY')+1;
minri:=minoftable('STATOFDAY')+1;
INSERT INTO STATOFDAY(stat_date,ok,nok_usr,nok_data,nok_service,ri) VALUES(indate,inok,innok_user,innok_data,innok_service,inri);
UPDATE RIOFTABLE SET MIN_RI=minri WHERE TABLE_NAME='STATOFDAY';
UPDATE RIOFTABLE SET MAX_RI=inri WHERE TABLE_NAME='STATOFDAY';
ELSE
inri:=maxoftable('STATOFDAY')+1;
INSERT INTO STATOFDAY(stat_date,ok,nok_usr,nok_data,nok_service,ri) VALUES(indate,inok,innok_user,innok_data,innok_service,inri);
UPDATE RIOFTABLE SET MAX_RI=inri WHERE TABLE_NAME='STATOFDAY';
END IF;
END insert_statofday;
在CLIENT通过SQL*PLUS全部试验通过。
可是如下程序却不能通过,为什么??(是不是ODBC的问题????)
StoreProc1.prepared:=True;
StoreProc1.Prepare;
StoreProc1.ParamByName('indate').AsDateTime:=time;
StoreProc1.ParamByName('inok').AsInteger:=1;
StoreProc1.ParamByName('innok_user').AsInteger:=2;
StoreProc1.ParamByName('innok_data').AsInteger:=3;
StoreProc1.ParamByName('innok_service').AsInteger:=4;
StoreProc1.ExecProc;(此时报错)
恳请各位专家能够帮助本人诊断,本人将不胜感激。(如果有类似环境的话
请大家帮忙试运行一下,好吗?)
DELPHI3
我在SERVER端建立了如下的存储过程:
create function maxoftable(tablename IN CHAR)
RETURN NUMBER
IS
maxri NUMBER(10);
BEGIN
SELECT max_ri INTO maxri FROM rioftable WHERE table_name=tablename;
RETURN(maxri);
END;
create function minoftable(tablename IN CHAR)
RETURN NUMBER
IS
minri NUMBER(10);
BEGIN
SELECT min_ri INTO minri FROM rioftable WHERE table_name=tablename;
RETURN(minri);
END;
create or replace procedure insert_statofday(indate IN DATE,inok IN NUMBER,innok_user IN NUMBER,innok_data IN NUMBER,
innok_service IN NUMBER)
AS
inri NUMBER(10);
minri NUMBER(10);
BEGIN
IF (maxoftable('STATOFDAY')-minoftable('STATOFDAY'))>363 THEN
DELETE FROM STATOFDAY WHERE RI=minoftable('STATOFDAY');
inri:=maxoftable('STATOFDAY')+1;
minri:=minoftable('STATOFDAY')+1;
INSERT INTO STATOFDAY(stat_date,ok,nok_usr,nok_data,nok_service,ri) VALUES(indate,inok,innok_user,innok_data,innok_service,inri);
UPDATE RIOFTABLE SET MIN_RI=minri WHERE TABLE_NAME='STATOFDAY';
UPDATE RIOFTABLE SET MAX_RI=inri WHERE TABLE_NAME='STATOFDAY';
ELSE
inri:=maxoftable('STATOFDAY')+1;
INSERT INTO STATOFDAY(stat_date,ok,nok_usr,nok_data,nok_service,ri) VALUES(indate,inok,innok_user,innok_data,innok_service,inri);
UPDATE RIOFTABLE SET MAX_RI=inri WHERE TABLE_NAME='STATOFDAY';
END IF;
END insert_statofday;
在CLIENT通过SQL*PLUS全部试验通过。
可是如下程序却不能通过,为什么??(是不是ODBC的问题????)
StoreProc1.prepared:=True;
StoreProc1.Prepare;
StoreProc1.ParamByName('indate').AsDateTime:=time;
StoreProc1.ParamByName('inok').AsInteger:=1;
StoreProc1.ParamByName('innok_user').AsInteger:=2;
StoreProc1.ParamByName('innok_data').AsInteger:=3;
StoreProc1.ParamByName('innok_service').AsInteger:=4;
StoreProc1.ExecProc;(此时报错)
恳请各位专家能够帮助本人诊断,本人将不胜感激。(如果有类似环境的话
请大家帮忙试运行一下,好吗?)