Subject Re: [IBO] IB_Import and reserved words
Author ashwiz_za
Helen, hi there

Thank you for help, much appreciated!!!

I have tried that, but still no luck...
(defining the field list in the FieldList property, no luck.

I have traced though Ib_Import, where it builds up the SQL, even
hard-coded the quotes ("default"), but where it crashes is where it calls
DSql.Prepare;

The sql is:
insert into TableX (code,description,"default",country_id)
values (:code,:description,:default,:country_id)

-SQL error code -206, Column unknown, default, At line 1 column 28

I have done similar import, with these same tables, but used IB_Query,
and built up the sql myself in a similar manner. It worked ok?
(I was connecting directly to Informix using bde, and then inserting
to firebird. Is same destination database, just this time I am reading
from txt files)

Do you think there is a chance I can get IB_Import to work, or should
I resort to manually doing it all like before?

(Is it possible to Alias the column names?)

Many thanx
Kind regards
ashley ;-)

--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
>
> At 07:16 PM 9/12/2005 +0000, you wrote:
> >Hi there
> >
> >I am using IB_Import, but am having trouble as of the columns names are
> >reserved words.
> >Now, normally I simply quote them and IB-Objects understands them
> >fine, but
> >with IB_Import
> >doesn't seem to work?
> >
> >Eg: CODE VARCHAR(5) NOT NULL,
> > DESCRIPTION VARCHAR(15),
> > "DEFAULT" CHAR(1),
> >
> >I am including the column names in the first line of the text file to
> >import, and
> >have tried using quotes there, but still same problem...
>
> Double-quotes have a special (non Fb/IB) significance in text data
> files. AFAIK, it should be enough to put quotes around the
offending field
> name in your FieldList property.
>
> If that still excepts, try removing the header line altogether and
defining
> your own list of (legal) field names in the FieldList property.
They can
> be Huey, Dewey and Louie or whatever you like, as long as they are
in the
> right order.
>
> That said, its impossible to tell from your problem description
whether you
> are getting trouble because of the source record definition or your
> destination table definition. You don't actually say what exception
you
> are getting, either.
>
> If the latter - that the insert or update statement being
constructed by
> the component causes an exception - it could be one of the following:
>
> 1) Your database is dialect 1. In that case, a quoted identifier
won't be
> legal.
>
> 2) The possibility that Delphi has an extra problem with a **column
name**
> of "DEFAULT" at some level of parsing, since this is also a keyword in
> Delphi and Delphi doesn't have any special syntax for making illegal
> keyword use legal.
>
> Helen
>