Re: Derby DB suddenly can't open

2014-05-15 Thread Bryan Pendleton

On 5/14/2014 2:38 AM,  wrote:

I am use 10.8.2.x for more than 2 years, and it works well till today. Suddenly 
I can't open it


Do you have the complete exception stack?

http://wiki.apache.org/db-derby/UnwindExceptionChain

thanks,

bryan




Unique constraints and nulls

2014-05-15 Thread John English

I have a table with two columns whose combined value I want to be unique:

  create table Foo (
A integer,
B integer,
primary key(A),
unique(A,B)
  );

This works fine except when B is null, when I can have multiple rows containing 
identical values of the form (A,null).


Is there an easy way to constrain the values of A to be unique even when B is 
null? (I could try to change things so that empty strings are used instead of 
nulls, but that would involve changing existing code and it will take quite a 
bit of work to ensure that there aren't any unexpected knock-on effects, so I 
prefer to stick with nulls if I can.)


TIA,
--
John English