Board index » delphi » Delphi TRUE/FALSE with Oracle

Delphi TRUE/FALSE with Oracle

Hi.

    I'm new to oracle and plan of buying it.  I download the free trial
version but i'm stick with a small problem.
When I try to post my record, I get an error that TRUE is not a valid
value for the field (my field is NUMBER 1).  Is there a way in delphi to
configure that TRUE is 1 and false 0?  Or maybe i'm not using a good
field declaration in Oracle...Need some help please, tanx a lot.

Christian Hamel
ChristianHa...@Videotron.Ca
Montral, Qubec

 

Re:Delphi TRUE/FALSE with Oracle


I don't know anything about Oracle so I can't help you choose a
more approprite field type that would more closely match
Delphi Boolean datatype.
However, to solve your immediate problem, you can transform
True and False to their respective values you want via
the Ord function.
John

Quote
Christian Hamel wrote in message <34C20B5D.40799...@Videotron.Ca>...
>Hi.

>    I'm new to oracle and plan of buying it.  I download the free trial
>version but i'm stick with a small problem.
>When I try to post my record, I get an error that TRUE is not a valid
>value for the field (my field is NUMBER 1).  Is there a way in delphi to
>configure that TRUE is 1 and false 0?  Or maybe i'm not using a good
>field declaration in Oracle...Need some help please, tanx a lot.

>Christian Hamel
>ChristianHa...@Videotron.Ca
>Montral, Qubec

Re:Delphi TRUE/FALSE with Oracle


Christian

Instead of a Boolean field, use a single char field in Oracle and limit
input to ('T', 'F', 'Y', 'N').  When using a DBCheckBox (for example),
there's a property which allows you to declare what value sets the
check on and which sets it off.  Simply set that and you're in great
shape.

Derek Davidson
Get a FREE copy of DK's Audit Components for Delphi from my web site:
http://freespace.{*word*269}.net/d.davidson
Now Includes INFOPOWER Derived components and a demo

(Remove the x to EMail me : der...@mksoft.com)

Other Threads