Subject Re: invalid insert: no columns
Author eamonnm2002 <eamonnm2002@yahoo.co.uk>
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 08:57 PM 25/02/2003 +0000, you wrote:
> >Hi,
> >
> >getting a weird error message when trying to insert using
> >TIBOQuery. The message is 'Invalid INSERT statement: No columns'.
> >
> >SQL is:
> >
> >select "PIN", "NAME"
> >from "FORMS"
> >where "PIN" = :PIN
> >
> >KeyLinks is set to "FORMS".PIN and the code is basicaly this:
> >
> >query.insert
> ><set fields>
> >query.post - error here
> >
> >i've used this approach before on my last project and it worked
> >well. the only difference this time is that this table has a
couple
> >of BLOB fields, and i've just upgraded to firebird 1.0.2 from 1.0
> >
> >any suggestions greatly appreciated!
>
> It looks as if you might be getting bitten somewhere by your
quoted
> identifiers. Your keylinks would need to be "FORMS"."PIN"
>
> What's the code you are using for your <set fields>?
>
> As for what else might or might not be happening, drop a
TIB_MonitorDialog
> onto your form, call its Show method in your FormCreate, and watch
what
> statement is going through to the API when Post is called on the
Insert.
>
> Helen

YES! the fault was with my quoting - removed quotes from fields and
table and everything worked as expected. Thanks v much.

cant remember why i started quoting everything - possibly because my
previous project has mixed case field names. what is the rule for
quoting? i know i have to quote field names that conflict with a
reserved word, not where wle it's needed.

thanks for the TIB_MonitorDialog tip, will keep that in mind.

FYI, the message i got didn't come fromthe server - it looked like
it was generated by IBO while it was bulding the field list for the
insert statement.

cheers.