Page 1 of 1

Error in TSQLStoredProc with parameters

Posted: Tue 08 Feb 2005 16:26
by Alex Bocchi
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 ???

Posted: Wed 09 Feb 2005 15:25
by Paul
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.

Posted: Sat 12 Feb 2005 10:00
by Alex Bocchi
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.