SP issue with money output parameters on MSSQL 2000

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
Nenad.B
Posts: 1
Joined: Wed 01 Feb 2012 12:40

SP issue with money output parameters on MSSQL 2000

Post by Nenad.B » Wed 01 Feb 2012 13:19

dbx driver version 5.0.2
delphi2006
MSSQL 2000 (works fine on 2005 and 2008)
EnableBCD=True //Have to be true, we are using this

SP Sample
ALTER PROCEDURE [dbo].[GetPrice] @PriceOK real OUTPUT, @PriceExcCause smallmoney OUTPUT AS
SET @PriceOK = 100
SET @PriceExcCause = 100

Delphi code:
with TSQLStoredProc.Create(Self) do
begin
SQLConnection:= ASQLConnection;
SchemaName := 'dbo';
StoredProcName := 'GetPrice';
Prepared := True;
ExecProc;
end;

Exception
_Database Server Error:_SQL Error Code:_257
Implicit conversion from data type varchar to smallmoney is not allowed. Use the CONVERT function to run this query.

the call extracted from Profiler:
declare @P1 varchar(67)
set @P1=NULL
declare @P2 varchar(67)
set @P2=NULL
exec dbo.GetPrices @P1 output, @P2 output
select @P1, @P2

Have checked the params after prepare in delphi. They are of ftFMTBcd type. Why is this type suddenly converted to varchar and only on MSSQL 2000? Is that a bug? Any known workaronds?

AndreyZ

Post by AndreyZ » Thu 02 Feb 2012 08:48

Hello,

Thank you for the information. We reproduced the problem and the investigation is in progress. We will notify you when we have any results.

AndreyZ

Post by AndreyZ » Thu 16 Feb 2012 14:04

We have fixed this problem. This fix will be included in the next dbExpress driver for SQL Server build.

Post Reply