Subject | Re: [IBO] Invalid Insert Statement: No columns |
---|---|
Author | mspencewasunavailable |
Post date | 2006-12-12T21:22:09Z |
--- In IBObjects@yahoogroups.com, "Jason Wharton" <supportlist@...>
wrote:
I think it's more than just reserved words. In addition to the
reserved word "Date", DESCRIPTION won't match "Description" nor
CODE, "Code".
I guess what I'm really asking is if it's true that the stuff in the
log is actually what is being used to send to Firebird? In other
words, if the log text is separately generated and the field name
quoting is broken at that point, that's a shame, but no big deal and
the problem I'm having may be due to something else in my code. If,
on the other hand, the field name that's in the log text is actually
what Firebird sees, that's a problem.
I found by stepping into the IBObjects code that the fields in the
internal dataset have no data at all. I'll see if I can figure out
just why this particular piece of code is different from the many
similar ones in other parts of the application.
Michael D. Spence
Mockingbird Data Systems, Inc.
wrote:
>make sure
> There is a global variable in TIB_Session.pas as follows:
>
> {: This global variable serves as a flag to tell if you want to
> andimproves
> check for reserved tokens automatically. Leaving this to false
> performance. If you use reserved tokens and manually put quotesaround them
> it should still be fine to leave this set to false.}stored and
> CheckForReservedTokens: boolean = false;
>
>
> The reason this is an issue is because of how identifiers are
> returned in the SQLVAR structures. I am not told if it is quotedor not,
> I'm just told what it actually is. Therefore, IBO has to figureout whether
> quotes are appropriate given the content of the identifier name.Reserved
> words pose a challenge in this.Similar code works fine in similar situations elsewhere in the app.
>
> Jason
I think it's more than just reserved words. In addition to the
reserved word "Date", DESCRIPTION won't match "Description" nor
CODE, "Code".
I guess what I'm really asking is if it's true that the stuff in the
log is actually what is being used to send to Firebird? In other
words, if the log text is separately generated and the field name
quoting is broken at that point, that's a shame, but no big deal and
the problem I'm having may be due to something else in my code. If,
on the other hand, the field name that's in the log text is actually
what Firebird sees, that's a problem.
I found by stepping into the IBObjects code that the fields in the
internal dataset have no data at all. I'll see if I can figure out
just why this particular piece of code is different from the many
similar ones in other parts of the application.
Michael D. Spence
Mockingbird Data Systems, Inc.
>[mailto:IBObjects@yahoogroups.com]On
> > -----Original Message-----
> > From: IBObjects@yahoogroups.com
> > Behalf Of mspencewasunavailablerecord's
> > Sent: Tuesday, December 12, 2006 9:49 AM
> > To: IBObjects@yahoogroups.com
> > Subject: [IBO] Invalid Insert Statement: No columns
> >
> >
> > Using IBObjects 4.7 beta 11, I'm trying to insert rows into a
> > TIBOTable. The table is set into append mode and the new
> > fields are updated using statements like this:be
> >
> > with tblEditInv do
> > begin
> > FieldByName('Date').AsDateTime :=
> > t.FieldByName('Date').AsDateTime;
> > FieldByName('Code').AsInteger :=
> > t.FieldByName('Code').AsInteger;
> > FieldByName('Serv ID').AsInteger :=
> > t.FieldByName('Serv ID').AsInteger;
> > FieldByName('Description').AsString :=
> > t.FieldByName('Description').AsString;
> >
> > (and so forth)
> >
> >
> > where t is another table with fields I want to present using
> > tblEditInv. When tblEditInv.Post is called I get the error
> > message "Invalid Insert Statement: No Columns".
> >
> > When I searched the archives, the only conversation I could find
> > about this was one that suggested that field name quoting might
> > an issue. I'm saddled with a database with many, many fieldnames
> > that need quoting, and there does seem to be something awry.ASC
> >
> > Here's my table definition:
> >
> > CREATE TABLE "EDITINV"(
> > "Date" DATE,
> > "Code" SMALLINT,
> > "Serv ID" INTEGER,
> > "Description" VARCHAR(45),
> > "Qty" NUMERIC(12,2),
> > "Amount" NUMERIC(14,4),
> > "Base Price" NUMERIC(12,2),
> > "Tax Code" SMALLINT,
> > "Tax" NUMERIC(12,2),
> > "Extended" NUMERIC(12,2),
> > "Crew" SMALLINT,
> > "Zone" SMALLINT,
> > "Route" SMALLINT,
> > "Cost" NUMERIC(12,2),
> > "Scheduled" VARCHAR(1),
> > "Qty Used" NUMERIC(12,2),
> > "Man Hours" NUMERIC(12,2),
> > "Old Date" DATE,
> > "Old Code" SMALLINT,
> > "Old Serv ID" INTEGER,
> > "Old Qty" NUMERIC(12,2),
> > "Old Amount" NUMERIC(14,4),
> > "Old Base Price" NUMERIC(12,2),
> > "Old Tax Code" SMALLINT,
> > "Old Tax" NUMERIC(12,2),
> > "Old Qty Used" NUMERIC(12,2),
> > "Old Man Hours" NUMERIC(12,2),
> > "INSTANCE_ID" INTEGER NOT NULL,
> > "SESSION_ID" INTEGER NOT NULL);
> >
> > ALTER TABLE "EDITINV" ADD CONSTRAINT "PK_EDITINV" PRIMARY KEY
> > (SESSION_ID, INSTANCE_ID);
> >
> >
> >
> > Here's an excerpt from the log when the table goes active:
> >
> > SELECT ALL EDITINV.*
> > FROM EDITINV
> > WHERE SESSION_ID = 6
> > ORDER BY EDITINV.SESSION_ID ASC
> > , EDITINV.INSTANCE_ID
> >SQLn
> > PLAN (EDITINV ORDER PK_EDITINV
> > INDEX (PK_EDITINV))
> >
> > FIELDS = [ Version 1 SQLd 29
> > 64<NIL>
> > EDITINV.DATE = <NIL>
> > EDITINV.CODE = <NIL>
> > EDITINV."Serv ID" = <NIL>
> > EDITINV.DESCRIPTION = <NIL>
> > EDITINV.QTY = <NIL>
> > EDITINV.AMOUNT = <NIL>
> > EDITINV."Base Price" = <NIL>
> > EDITINV."Tax Code" = <NIL>
> > EDITINV.TAX = <NIL>
> > EDITINV.EXTENDED = <NIL>
> > EDITINV.CREW = <NIL>
> > EDITINV.ZONE = <NIL>
> > EDITINV.ROUTE = <NIL>
> > EDITINV.COST = <NIL>
> > EDITINV.SCHEDULED = <NIL>
> > EDITINV."Qty Used" = <NIL>
> > EDITINV."Man Hours" = <NIL>
> > EDITINV."Old Date" = <NIL>
> > EDITINV."Old Code" = <NIL>
> > EDITINV."Old Serv ID" = <NIL>
> > EDITINV."Old Qty" = <NIL>
> > EDITINV."Old Amount" = <NIL>
> > EDITINV."Old Base Price" =
> > EDITINV."Old Tax Code" =<NIL>
> > EDITINV."Old Tax" = <NIL><NIL>
> > EDITINV."Old Qty Used" =
> > EDITINV."Old Man Hours" =<NIL>
> > EDITINV.INSTANCE_ID = <NIL>
> > EDITINV.SESSION_ID = <NIL> ]
> >
> > I don't know if this is sigificant, but fields such
> > as "Date", "Qty", "Description" and other one-token names are all
> > shown in the log as upper case, whereas fields like "Qty Used" is
> > properly quoted.
> >
> > Does this ring any bells with anyone?
> >
> > Michael D. Spence
> > Mockingbird Data Systems, Inc.
>