Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

using bde for database field with 6 decimal

Posted on 2004-03-23
15
Medium Priority
?
908 Views
Last Modified: 2012-05-04
hi,
l'm using delphi 7 with bde. l'm having problem with database table which field have 6 decimal points.i used TQuery to retrieve the data and present to dbgrid. but its only show up to 4 decimal.
as i knew, bde will create BCD field for this but BCD can only support up to 4 decimal.the only fieldtype that can support up to 6 decimal is ftFMTBCD. i've tried to change the datatype to ftFMTBCD of fieldefs at runtime and re-create the field. when i opened the Tquery, it raised error
'expecting ftFMTBCD, actual ftBCD'. i cannot change bde to use others like dbexpress. any solution for this problem ? please....i really need solution to complete my application. any help would be appreciated.

thank you.

regards
eddie
0
Comment
Question by:Explorer060599
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
15 Comments
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10665868
What is the database? Pdox? IB?....
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10668356
i hate bcd ....
what database?
listening . . .

0
 

Author Comment

by:Explorer060599
ID: 10673282
oracle and mssql. i need to support both.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 10674814
usual i tested it on oracle,
since there is no decimal-type,
you have to define the field as
NUMBER(9,6) for example

such fields are treated as TFloatfield,
and there are no display issues

meikl ;-)
0
 

Author Comment

by:Explorer060599
ID: 10674866
because i've enabled the BCD in BDE. but i cannot disable it for somereason. anyway out ?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10674886
on oracle this setting has no effect

such fields are also treated as TFloatfield then

meikl ;-)
0
 

Author Comment

by:Explorer060599
ID: 10674993
i get TFloatfield when i disable the "Enable BCD" in bde. when it get enabled, it create field as TBCDField.
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10675094
so use a tdatabase....
create an Alias In TDatabase linked to the oracle one, then double click on the Tdatabase and load the Defaults in the Wizard, then change the EnableBCD value there to FALSE...finally add your TDAtasets linked to the TDatabase Alias...
try this and tell us about it....
0
 

Author Comment

by:Explorer060599
ID: 10675230
as i mentioned, i cannot disable the "Enable BCD" since i need tbcdfield as well for others decimal field on preventing rounding error. but i also need to handle field more than 4 decimal.
0
 

Accepted Solution

by:
Explorer060599 earned 0 total points
ID: 10683623
l've found a workaround that uses TField.GetData and SetData. just hook on the TField.OnGetData and onsetdata, manually convert text to bcd and from.  the exmple can download from below's link
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=13959

can i cancel this question now ?

btw, thank you for helps very very much.

regards
eddie
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10685104
For me it's OK to PAQ and Refund....

F68 ;-)
0
 

Author Comment

by:Explorer060599
ID: 10685177
i dont know if its fair to your,bcox i found the solution myself. please tell me if i need to give point.
i dont mind to give point, the things i care abt is your helps. really really appreciate.

thank you.

regards
eddie
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question