Subject Re: [ib-support] a newbie questions
Author Helen Borrie
Jay,
Your problems are several, so please forgive me if I provide a fairly terse
response. You can then pick up on stuff that still puzzles you and ask us
some more focused questions.

At 02:24 AM 21/04/2003 +0000, you wrote:
>I installed Firebird 1.0 on a Win nt 4.0 sp6 workstation.
>I then used IB_WISQL.exe to create the database called Instsql.gdb.
>(Aside comment; I also have a eval copy of IBAdmin3 installed on my
>machine.) I then created (see SQL statement below)a table called
>INVENTOR using paradox 10.0 and the builtin INTRBASE version 4.0
>driver.

This driver belongs to a very old Interbase version and doesn't "know"
about the later on-disk structures (ODS) of more recent IB versions or
Firebird. You will be able to use it (at a pinch), provided you don't try
to use features that were not supported back then. I will mention these as
I go through your message.

>I saw one problem after I created the table; the fields that
>I declared as DATE are created as TIMESTAMP.

The old ODS does not have a "date-only" date type. It stores DATE as
something approximately equivalent to the Paradox Timestamp.

A Firebird database created in Dialect 1 will respect the old DATE type. A
dialect 3 FB database expects a DATE type to be date-only.


>The next issue is even stranger; when I attempted to fill the table
>from a paradox table it seems that all the fields except for the DATE
>fields are loaded (see INSERT query #1).

If your statement didn't fail with an exception, then I conclude you made a
dialect 3 database. This is possibly a casting issue but it would be just
a guess unless there were a better description of what appeared in the table.

For some clues, you might like to get hold of the IB 6 beta release notes
and Migration Guide, linked from the IBPhoenix website (www.ibphoenix.com).

>If I only load the primary
>key plus the date fields the load is successful (see INSERT query #2).

Again, not being clear about what didn't work in the first query, it would
just be guessing.

Unclear are: was the client program you used ib_wisql.exe or
wisql.exe? The first is a (very old) IB objects tool that doesn't use the
BDE; the second is an old Borland tool that doesn't "know" about Dialect 3
and uses the BDE and thus your ancient IB driver. IBAdmin doesn't use the
BDE either, but it does use InterBasExpress (IBX) which is known to have
some incompatibilities with the more recent Firebird subreleases.


>Does anyone have any suggestions.

Certainly, you should arm yourself with the IB 6 Data Definition Guide, to
get a clearer picture in your head about what data types you should be
using. The date and time types are of particular interest for *this*
problem, but your choice of CHAR() for all of the Paradox type 'A' field
types is a mistake. CHAR() should be used only for fixed-length, full-out
strings like codes, etc.

DOUBLE PRECISION is not a good choice for currency types - you need to use
a scaled numeric type (NUMERIC(s,p) or DECIMAL(s,p) for currency. Reserve
single and double floating types for "things you measure, not things you
count".

I think you have some fairly fundamental relational problems to sort out of
this structure, as well....

regards,
heLen