Stored procedure with bigint input-output parameter (type map error?)
Posted: Wed 17 Aug 2005 12:36
I'm calling a stored procedure with the following interface:
In Delphi I create a TSQLDataset. After setting CommandType to ctSoredProcedure and CommandText to 'Procname', I inspect the automaticly created parameter. It's type is ftBCD. I think this is correct, though a bit strange.
Using the MS profiler, I can see that the statement for executing this stored procedure, that is sent to SQL Server, declares my parameter as varchar(67). When querying the resulting value, it is wrongly interpreted (type casted) as a BCD value in Delphi. (ie. a value returned by the stored procedure was '4300000455' (correct) and after typecasting the buffer containing this value was interpreted as 3.303)
I discovered that this problem does not occur when I use an older dbexpsda.dll version 1.84.0.0. That version declares my parameter with type money instead of varchar(67). In this case the typecast works fine.
If this is a bug of the dbExpress driver then I would like to see this fixed. If i'ts not a bug then what am I doing wrong
I'm using:
- Delphi 7
- dbExpress driver for SQL Server 2.50.5.0
- MS SQL Server 2000 SP3a
Thanks![/b]
Code: Select all
CREATE PROCEDURE Procname (@Paramname bigint Output)
Using the MS profiler, I can see that the statement for executing this stored procedure, that is sent to SQL Server, declares my parameter as varchar(67). When querying the resulting value, it is wrongly interpreted (type casted) as a BCD value in Delphi. (ie. a value returned by the stored procedure was '4300000455' (correct) and after typecasting the buffer containing this value was interpreted as 3.303)
I discovered that this problem does not occur when I use an older dbexpsda.dll version 1.84.0.0. That version declares my parameter with type money instead of varchar(67). In this case the typecast works fine.
If this is a bug of the dbExpress driver then I would like to see this fixed. If i'ts not a bug then what am I doing wrong

I'm using:
- Delphi 7
- dbExpress driver for SQL Server 2.50.5.0
- MS SQL Server 2000 SP3a
Thanks![/b]