Error in TSQLStoredProc with parameters

Error in TSQLStoredProc with parameters

Postby Alex Bocchi » Tue 08 Feb 2005 16:26

Delphi6 SP2
ORACLE 8.05
dbexpoda.dll 2.50.1
When recompiling stored proc. , parameters are passed in wrong order.
There is a way to correct this problems ???
Alex Bocchi
 

Postby Paul » Wed 09 Feb 2005 15:25

Order of parameters in Params list is important. Did this procedure work with this application before recompiling? Try call call it using standard Borland Oracle driver.
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Postby Alex Bocchi » Sat 12 Feb 2005 10:00

With Borland Oracle Driver works fine.
This is the problem :
A) You build a stored procedure
CREATE OR REPLACE PROCEDURE SP_TEST
( in_START IN DATE, in_END IN DATE, in_TYPE IN CHAR ) IS
BEGIN NULL; END;

B) You place your TSQLStoredProc ( sp ) component
sp.ParamByName('IN_START').asSQLTimeStamp := DateTimeToSQLTimeStamp( Date );
sp.ParamByName('IN_END').asSQLTimeStamp := DateTimeToSQLTimeStamp( Date );
sp.ParamByName('IN_TYPE').AsString := 'N';
sp.ExecProc ---- OK
C) You now had to do : ALTER PROCEDURE SP_TEST COMPILE.
Repeat it 3-4 times
D) Repeat B ... and you have an error.If you clear parameter you see that is placed in different order.You have an error only because parameters were of different type , if they are of the same type you have not an error but they are passed in wrong order. This is the esplanation of various strange problems in my application.

With Borland driver ther is not this problem ... many others ... but not this.
Thanks.
Alex Bocchi
 


Return to dbExpress driver for Oracle