Oliver Peters wrote:
> example_01:
> ----------
> CREATE TABLE doesntwork(
> id INTEGER PRIMARY KEY AUTOINCREMENT,
> someint INTEGER,
> sometext TEXT,
> UNIQUE(someint)
> );
>
> INSERT INTO doesntwork(someint,sometext) VALUES(2,'Douglas Adams');
>
> example_02:
> ----------
> CREATE TABLE works(
> id INTEGER PRIMARY KEY AUTOINCREMENT,
> someint INTEGER,
> sometext TEXT
> );
>
> INSERT INTO works(someint,sometext) VALUES(1,'Hitchhikers guide to galaxy');
> INSERT INTO works(someint,sometext) VALUES(2,'Douglas Adams');
>
>> Are you having problems with all UNIQUE constraints or just some of them?
>> Perhaps the difference is whether or not the column in question has nulls
>> in it.
>
> there are no NULLS in my example and I don't believe in a frontend-problem (I
> wouldn't interpret the SQL.LOG this way).
You may not have inserted any NULLs but your table definition allows for the
storage of nulls.
Try making all of your column definitions NOT NULL and see if that makes any
difference. That is, see if this works:
CREATE TABLE wasdoesntwork(
id INTEGER PRIMARY KEY AUTOINCREMENT,
someint INTEGER NOT NULL,
sometext TEXT NOT NULL,
UNIQUE(someint)
);
Also, can you simplify your examples further? If you take away the sometext
columns from both examples, do you get the same failure or success? What if
you
take away the id column and only have the someint? (I don't recall if you said
the UNIQUE only didn't work if the primary key was used.)
Separately, as was reported in another reply, this issue is something you
should
report as a bug to the OpenOffice people, since I think you said an alternate
connection method, MS Access worked fine?
-- Darren Duncan
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users