db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English <john.fore...@gmail.com>
Subject Re: adding a record to a table
Date Sun, 16 Feb 2014 08:58:45 GMT
On 15/02/2014 22:05, Bob M wrote:
> Hello John
> Table Specs:-
> //+ "PRIMARY KEY (Trading_Date, Trading_Time)");
> Does this help?

It's still not clear if this is the constraint being violated. The data looks 
OK, assuming that the table does not already contain the key (2014-02-14,12) 
which I assume was the first thing you would have checked.

It's usually better to give names to constraints, e.g.

   CONSTRAINT xxx_pk PRIMARY KEY (Trading_Date, Trading_Time)

so that the error message refers to xxx_pk rather than SQL14021012215370. It's 
always possible that some other contraint is being violated (e.g. by a trigger 
which is fired by the insert). Why not try naming your constraints and see if 
that tells you more about what's happening? You can drop the existing 
constraints and then add them back with names using ALTER TABLE.

You can also set derby.language.logStatementText=true in derby.properties for 
even more information.

John English

View raw message