Page 1 of 1

BDC overflow using StoredProc w/ OUTPUT Param SmallMoney

Posted: Thu 17 Nov 2005 18:41
by jeff.lott
dbExpress driver ver 2.50.4.0
MS SQL ver 8.00.760 (SP3)
Delphi 7

Stored Procedure:
CREATE PROCEDURE SalesCommission_Get @IDemp Integer, @Age Integer, @Markup MONEY, @Comm smallmoney OUTPUT AS
...

----------------------------
Using ISQL Query Utility:
DECLARE
@IDemp Integer,
@Age Integer,
@Markup MONEY,
@Comm MONEY

SET @IDemp = 120;
SET @Age = 0;
SET @Markup = 2.6925;
SET @Comm = 0;
exec SalesCommission_Get @IDemp, @Age, @Markup, @Comm OUTPUT;
Print Str(@Comm, 7,4);

5.0000 is printed out

------------------------------
Calling TSQLDataSet .ExecSQL(false) using same param values
gives a "BDC overflow" exception.

TSQLDataSet Param "Comm" set as follows:
DataType: ftBCD
NumericScale: 4
ParamType: ptOutput
Precision: 10
Size: 0

Default after setting TSQLDataSet with SProc name is:
NumericScale: 0
ParamType: ptInputOutput
Precision: 0
Size: 34

This also gives "BCD overflow"

What am I missing?
Thanks,
Jeff

Posted: Thu 17 Nov 2005 19:21
by jeff.lott
Ahhhhh,

Var
cVal: Currency;
Begin
...
cVal := 3.5;
...
TSQLDataSet .Params.ParamByName('Markup').AsCurrency := cVal;
TSQLDataSet .ExecSQL(false); // Causes "BCD OverFlow

TSQLDataSet .Params.ParamByName('Markup').AsBCD := cVal;
TSQLDataSet .ExecSQL(false); // is OK

TSQLDataSet .Params.ParamByName('Markup').AsCurrency := cVal;
doesn't throw an error, but ExecSQL doesn't like it!!??

Posted: Fri 18 Nov 2005 15:10
by Ikar
Try to download DbxSda last version (2.50.7). If problem persists then send us (dbxsda*crlab*com) complete small sample to demonstrate it and include script to create server objects.