Board index » delphi » BCD TRUE OR FALSE???

BCD TRUE OR FALSE???

Hi,

I work on an application using both D3.01 C/S and MSSQL 6.5 (SP4)

I wonder what the BDE BCD parameters exactly means???

The doc says that it is used to use fixed precision format (BCD : precision
= 10e-4) with currencies with BCD=TRUE (generates a TBCDField in Delphi) and
float (with approximations?) when BCD=FALSE (generates a TCurrencyField in
delphi)...
But currencies (MONEY) are stored as BCD in SQL Server? So what is that used
for???

My app has approx 2100 stored procedures, with allways persitent
fields...And quite every Stored Proc uses money types...
Is there an easy way to switch the BCD from TRUE to FALSE or FALSE to TRUE
if needed? I don't want to have to take each and every SP by hand to change
to type of the fields...

thanx for your help.
ps : please reply both via this newsgroup and via email !

 

Re:BCD TRUE OR FALSE???


Hi Olivier.

Quote
Olivier Deckmyn wrote in message <6u5ido$m...@forums.borland.com>...
>Hi,

>I work on an application using both D3.01 C/S and MSSQL 6.5 (SP4)

>I wonder what the BDE BCD parameters exactly means???

>The doc says that it is used to use fixed precision format (BCD : precision
>= 10e-4) with currencies with BCD=TRUE (generates a TBCDField in Delphi)
and
>float (with approximations?) when BCD=FALSE (generates a TCurrencyField in
>delphi)...
>But currencies (MONEY) are stored as BCD in SQL Server? So what is that
used
>for???

The BCD fllag is used internally in the BDE-ODBC interface. When you call a
SQLBindCol, you specify a destination buffer type. For money fields, you can
specify either float or some kind of precision field type. The ODBC-driver
is performing the translation, so if you use float, only one conversion
takes place. If you use Currency, and BCD enabled, a little extra overhead
is implemented translating the destination SQL_C.. type to the Currency
type.

Quote
>My app has approx 2100 stored procedures, with allways persitent
>fields...And quite every Stored Proc uses money types...
>Is there an easy way to switch the BCD from TRUE to FALSE or FALSE to TRUE
>if needed? I don't want to have to take each and every SP by hand to change
>to type of the fields...

I don't understand. The BCD-enable is only used internally in the BDE.
Regards
Stig Johansen

Re:BCD TRUE OR FALSE???


Quote
Stig Johansen wrote in message <6u78vh$o...@forums.borland.com>...
>Hi Olivier.
>The BCD fllag is used internally in the BDE-ODBC interface. When you call a
>SQLBindCol, you specify a destination buffer type. For money fields, you
can
>specify either float or some kind of precision field type. The ODBC-driver
>is performing the translation, so if you use float, only one conversion
>takes place. If you use Currency, and BCD enabled, a little extra overhead
>is implemented translating the destination SQL_C.. type to the Currency
>type.

Ok ...but only using ODBC driver?

Quote
>>My app has approx 2100 stored procedures, with allways persitent
>>fields...And quite every Stored Proc uses money types...
>>Is there an easy way to switch the BCD from TRUE to FALSE or FALSE to TRUE
>>if needed? I don't want to have to take each and every SP by hand to
change
>>to type of the fields...
>I don't understand. The BCD-enable is only used internally in the BDE.
>Regards
>Stig Johansen

If you set BCD to false, making persistent field for your SP will build
TFloatField for currency...
If you set BCD to TRUE, making persistent field for your SP will build
TBCDField for currency...
So if you change the BCD parameter after, you have to delete all the
persistent fields, and rebuild all of them...
And as I have near to 2100 stored proc. this is gonna be quite long !
Quote

Re:BCD TRUE OR FALSE???


Quote
Olivier Deckmyn wrote in message <6u7n0k$p...@forums.borland.com>...

>Stig Johansen wrote in message <6u78vh$o...@forums.borland.com>...
>>Hi Olivier.
>>The BCD fllag is used internally in the BDE-ODBC interface. When you call
a
>>SQLBindCol, you specify a destination buffer type. For money fields, you
>can
>>specify either float or some kind of precision field type. The ODBC-driver
>>is performing the translation, so if you use float, only one conversion
>>takes place. If you use Currency, and BCD enabled, a little extra overhead
>>is implemented translating the destination SQL_C.. type to the Currency
>>type.

>Ok ...but only using ODBC driver?

I don't know.
Personally I only use ODBC-connections for maximum connectivity, so I have
no interest in other desktop/native drivers.

- Show quoted text -

Quote

>>>My app has approx 2100 stored procedures, with allways persitent
>>>fields...And quite every Stored Proc uses money types...
>>>Is there an easy way to switch the BCD from TRUE to FALSE or FALSE to
TRUE
>>>if needed? I don't want to have to take each and every SP by hand to
>change
>>>to type of the fields...

>>I don't understand. The BCD-enable is only used internally in the BDE.
>>Regards
>>Stig Johansen

>If you set BCD to false, making persistent field for your SP will build
>TFloatField for currency...
>If you set BCD to TRUE, making persistent field for your SP will build
>TBCDField for currency...
>So if you change the BCD parameter after, you have to delete all the
>persistent fields, and rebuild all of them...

Or maybe you can use 'replace all' in the .pas and the .dfm file.

Quote
>And as I have near to 2100 stored proc. this is gonna be quite long !

Ok now I see. I understood in the first place, you needed to change your
SP's, but now I see you are talking about the persistent field definition.
Since this is design time definitions, you may need to change theese.

Regards
Stig Johansen

Other Threads