Page 1 of 1

[SOLVED]: SQLite3 Posting error with "index" as a field name

Posted: Wed 15 Dec 2010 00:53
by LongHairCook
First off thanks for making an excellent set of components!

I'm currently testing uniDAC v3.50.0.13 and have come across an error posting to a SQLite3 table with "index" as a field name with, which also happens to be the primary key field and is part of a secondary key. Not my table I'm testing against so can't change the field name. Tested the table against multiple front ends and they handle posting to the table fine.

I did however change the field name to test if the error would go away if the field name "index" wasn't actually the name and there wasn't an error on post.

Any suggestions/fixes for this besides the obvious of changing the field name and associated indexes?

Any help would be greatly appreciated.

Posted: Wed 15 Dec 2010 15:51
by bork
Hello

Can you provide DDL script for creating your table where the same filed is a part of the primary key and a part of the secondary key. It will be very helpful to resolve this issue.

Posted: Wed 15 Dec 2010 16:02
by LongHairCook
Hi,

Thanks for the quick response! Here's the SQL taken from SQLite Administrator:

CREATE TABLE Categories(
[index] [integer] NOT NULL PRIMARY KEY,
[active] [integer] NOT NULL DEFAULT (1),
[deleted] [integer] NOT NULL DEFAULT (0),
[icon] [integer] NOT NULL DEFAULT (-1),
[name] [varchar](255) NOT NULL DEFAULT ('Something'),
[parentIndex] [integer] NOT NULL DEFAULT (0),
[originalName] [varchar](255) NOT NULL DEFAULT (''));

CREATE UNIQUE INDEX Categories_IndexAndActiveAndDeletedAndNameAndParentIndex on Categories (
[index] ASC,
[active] ASC,
[deleted] ASC,
[name] ASC,
[parentIndex] ASC);

Thanks again for taking the time in looking at this.

Posted: Thu 16 Dec 2010 08:16
by AlexP
Hello,

To resolve the problem you should set the UniQuery.Options.QuoteNames property to true.

Posted: Thu 16 Dec 2010 16:10
by LongHairCook
To resolve the problem you should set the UniQuery.Options.QuoteNames property to true.
This worked like a charm. Thanks very much for the quick responses. It's great to see support as good as the components!

Posted: Thu 16 Dec 2010 16:22
by AlexP
Hello,

It is good to see that this problem was solved. If any other questions come up, please contact us.