Subject | Re: [Firebird-Java] Creating unique column entries |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-09-27T20:06:57Z |
> I'm not sure this is even a Jaybird question. I'm using Firebird 1.5As far as I remember, constraints are evaluated on commit. So, if you set
> on Windows. I created a talble like this:
>
> CREATE TABLE Vehicle
> (
> Id char(10),
> Name varchar(32) NOT NULL unique,
> CONSTRAINT PK_Vehicle PRIMARY KEY (Id)
> );
>
> I want to make sure that no two vehicles have the same name.
> However, the followin does not cause an exception:
>
> statement.execute("insert into vehicle values('1', 'Foo')");
> statement.execute("insert into vehicle values('2', 'Foo')");
>
> Any ideas why?
auto-commit to false, you will get exception only when you commit data. Is
it your case?
Roman