Subject | Escape characters break generated SQL |
---|---|
Author | mspencewasunavailable |
Post date | 2006-12-12T21:09:10Z |
Between beta 7 and beta 11, you evidently introduced some sort of
character escaping which is interfering with things that were ok in
beta 7:
var
tblInvoice : TIBOTable;
refers to a table that is defined like this:
CREATE TABLE "ARINV"(
"Acc ID" INTEGER NOT NULL,
"Invoice #" VARCHAR(25) NOT NULL,
"Date" DATE NOT NULL,
"Sub Total" NUMERIC(12,2),
"Tax" NUMERIC(12,2),
"Freight" NUMERIC(12,2),
"Total" NUMERIC(12,2),
"Due Date" DATE,
(..and so forth, fields clipped for brevity)
With a primary key:
ALTER TABLE "ARINV"
ADD CONSTRAINT "PK_ARINV"
PRIMARY KEY ("Acc ID","Invoice #","Date");
When I do this:
tblInvoice.FindNearest([ID, nil, nil]);
The table used to get positioned to the first invoice for that
account, but now I get an SQL error:
ISC ERROR CODE:335544569
ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -206
Column unknown
Invoice \#
At line 6, column 73
STATEMENT:
TIB_LocateCursor: "<TDBCustomer>.<TIBOTable>.<TIBOInternalDataset>.<T
IB_LocateCursor>." stHandle=88 (ERROR)
STATEMENT:
TIBOInternalDataset: "<TDBCustomer>.
SQL ERROR CODE:-206
SQL ERROR MESSAGE:
Column does not belong to referenced table
SELECT ARINV."Acc ID", ARINV."Invoice #", ARINV."Date"
FROM ARINV
WHERE (
ARINV."Acc ID" = ? /* ID */
)
AND ((("Acc ID" > ? /* LOC_0 */ ) OR (("Acc ID" = ? /* LOC_0 */ )
AND (("Invoice \#" > ? /* LOC_1 */ ) OR (("Invoice \#" = ? /* LOC_1
*/ ) AND (("Date" >= ? /* LOC_2 */ )))))))
ORDER BY "Acc ID" ASC
, "Invoice \#" ASC
, "Date" ASC
The field named "Invoice #" is now "Invoice \#" in the generated
SQL. If I plug in values for all of the params, then FlameRobin
gives the same error. If I remove the backslashes as well, the
query works.
Michael D. Spence
Mockingbird Data Systems, Inc.
character escaping which is interfering with things that were ok in
beta 7:
var
tblInvoice : TIBOTable;
refers to a table that is defined like this:
CREATE TABLE "ARINV"(
"Acc ID" INTEGER NOT NULL,
"Invoice #" VARCHAR(25) NOT NULL,
"Date" DATE NOT NULL,
"Sub Total" NUMERIC(12,2),
"Tax" NUMERIC(12,2),
"Freight" NUMERIC(12,2),
"Total" NUMERIC(12,2),
"Due Date" DATE,
(..and so forth, fields clipped for brevity)
With a primary key:
ALTER TABLE "ARINV"
ADD CONSTRAINT "PK_ARINV"
PRIMARY KEY ("Acc ID","Invoice #","Date");
When I do this:
tblInvoice.FindNearest([ID, nil, nil]);
The table used to get positioned to the first invoice for that
account, but now I get an SQL error:
ISC ERROR CODE:335544569
ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -206
Column unknown
Invoice \#
At line 6, column 73
STATEMENT:
TIB_LocateCursor: "<TDBCustomer>.<TIBOTable>.<TIBOInternalDataset>.<T
IB_LocateCursor>." stHandle=88 (ERROR)
STATEMENT:
TIBOInternalDataset: "<TDBCustomer>.
SQL ERROR CODE:-206
SQL ERROR MESSAGE:
Column does not belong to referenced table
SELECT ARINV."Acc ID", ARINV."Invoice #", ARINV."Date"
FROM ARINV
WHERE (
ARINV."Acc ID" = ? /* ID */
)
AND ((("Acc ID" > ? /* LOC_0 */ ) OR (("Acc ID" = ? /* LOC_0 */ )
AND (("Invoice \#" > ? /* LOC_1 */ ) OR (("Invoice \#" = ? /* LOC_1
*/ ) AND (("Date" >= ? /* LOC_2 */ )))))))
ORDER BY "Acc ID" ASC
, "Invoice \#" ASC
, "Date" ASC
The field named "Invoice #" is now "Invoice \#" in the generated
SQL. If I plug in values for all of the params, then FlameRobin
gives the same error. If I remove the backslashes as well, the
query works.
Michael D. Spence
Mockingbird Data Systems, Inc.