Subject | Re: tBooleanField from BDE / Paradox |
---|---|
Author | bwc3068 |
Post date | 2006-03-16T18:09:24Z |
thankyou very much for the detailed info.
it certainly helps me along.
regards
kelly
--- In IB-Conversions@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
it certainly helps me along.
regards
kelly
--- In IB-Conversions@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
>FireBird....
> At 11:15 AM 15/03/2006, you wrote:
> >hi--
> >
> >i've heard there is no such thinkg as a tBooleanField in
> >type.
> >is that true?
>
> Yes. In database terms, Firebird doesn't support a Boolean data
>your
>
> >how do i go about converting all my BDE/Paradox tBooleanFields?
>
> Decide whether you want to use a SMALLINT or a CHAR to represent
> Boolean type.(unknown
>
> In logic terms, a Boolean can be be true, false or unknown
> is represented by NULL). If you want to enforce strict two-statedefinition.
> Boolean like Paradox (defaults to False and can only be True or
> false) then you add DEFAULT and NOT NULL constraints to the field
>(and
> You can do it the hard way (field by by field) or you can create a
> Boolean domain that you'll use for all of your Paradox
> Booleans. Don't name the domain "boolean" because recent SQL
> standards have defined specifications for a type named BOOLEAN
> it will become a reserved word eventually and break yourdefinitions).
>will
> CREATE DOMAIN D_BOOLEAN AS CHAR
> DEFAULT 'F' NOT NULL
> CHECK (
> (VALUE IN ('Y', 'N'))
> AND (VALUE = UPPER(VALUE)) )
>
> or, if you prefer SMALLINT:
>
> CREATE DOMAIN D_BOOLEAN AS SMALLINT
> DEFAULT '0' NOT NULL
> CHECK (
> (VALUE IN (1,0)) )
>
> Now, whenever you define a field with D_BOOLEAN as the type, it
> have these characteristics.Paradox
>
> Then, in your conversion process, you will need to read the
> Boolean and match it up with your D_Boolean true and false values.(the
>
>
> >any other field types that don't exist?
>
> Oh yes indeed! You don't say what mechanism you are doing for the
> conversion but, before you start, you are going to have to decide
> what to do with your numeric, integer and date fields.
>
> Paradox's Number is a floating point type.
>
> -- If it is being used for things you count (like money, yardages,
> etc.) then convert it to a fixed point type (decimal or numeric,
> there's no difference in Firebird. DECIMAL and NUMERIC have
> precision (the whole length of the number, in bytes) and scale
> number of decimal places you want to store). You have 18positions
> of precision available. Paradox's Money type should be convertedto
> Numeric(18,2), BCD type should be NUMERIC(18,4).then
>
> -- If it is being used for things you measure (like temperature)
> make it DOUBLE PRECISION (a floating point type)ignore it.
>
> -- FLOAT is at the low end of usefulness so you can pretty much
>and
> Dates
>
> Depends on Paradox version. If > pdx 4 then the types DATE, TIME
> TIMESTAMP correspond. Below pdx 4, there will be "challenges".(n).
>
> Alpha fields should be VARCHAR(n) of the appropriate length. For
> fixed length Alphas (like ISBN numbers, barcodes, etc.) use CHAR
>be
> Memo should be BLOB SUB_TYPE TEXT. Graphic and OLE types should
> BLOB SUB_TYPE BINARY. FormattedMemo depends on the content: ifit
> is readable as text, e.g. RTF or HTML, you'll want SUB_TYPE TEXT,to
> otherwise make it BINARY.
>
> Autoincrement type isn't supported but Firebird has a superior way
> do auto-incrementing numbers. Seetriggers
> http://firebird.sourceforge.net/index.php?op=faq#q0011.dat
> Define these columns as BigInt, define the generator and the
> and set the generator to the highest value of the existing datathe
> BEFORE before you start the data conversion.
>
> That's not the definitive How-To, by the way. As a minimum, read
> old IB 6 manuals (esp. DataDef.pdf and LangRef.pdf) before youlaunch
> into this.
>
> Helen
>