Subject Re: Constraint problem when there should be none
Author nagypapi
Hy Evgeney,
you and Roman are as fast as lightning,
nearly as fast as the hand of Chuck Norris

--- In Firebird-Java@yahoogroups.com, å×ÇÅÎÉÊ ðÕÔÉÌÉÎ
<evgeneyputilin@...> wrote:
>
> Hi John
> > Embedded Firebird 1.5.3
> > jaybird 2.0.1
> >
> > I have a table:
> > CREATE TABLE ORDERED (
> > ORDER_ID BIGINT NOT NULL,
> > .... some basic fields ...
> > );
> >
> > and a constraint:
> > ALTER TABLE ORDERED ADD PRIMARY KEY (ORDER_ID);
> > this is the integ_85 contstraint referred to below
> >
> > I try to update the following lines in non-autocommit mode:
> > st.executeUpdate("ALTER TABLE ORDERED ADD ADDITIONAL_PRICE BIGINT
> > DEFAULT 0 NOT NULL");
> > st.executeUpdate("UPDATE ORDERED SET ADDITIONAL_PRICE = 0");
> >
> > And I get the following error:
> >
> > org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544665.
> > violation of PRIMARY or UNIQUE KEY constraint "INTEG_85" on table
> > "ORDERED"
> .....
> >
> > Is this normal?
> What you undestund about normal? IMHO this question about Firebird
1.5.3 not Jaybird.
> Firebird under 2.0(not include 2.0) allow to work with data with
modified and not commited metadata.

So from 2.0 onwards, altering fields needs a commit before I can
access it's values? That's logical, I always wondered why I could do
it without commiting in 1.5.x :).

>
> I have question column ORDER_ID containts unique or not unique values?

order_id was always a primary key and after checking it with a query
it doesn't have duplicate entries

This error doesn't really hinder my progress, so If it's probably
"fixed" in 2.0, I can live with commiting ddl statements.

Thanks,
John