db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Leroux <s...@wanadoo.fr>
Subject Custom sequences/generators
Date Fri, 21 Aug 2009 10:20:24 GMT
Hi,

Following the thread started by Thomas Hill who needs to store a 
generated value in a column, I was wondering if I can define my own 
SEQUENCE (or  /GENERATOR/) in DERBY. Allowing one to write:
CREATE TABLE Client (
     CreatedBy varchar(30) GENERATED ALWAYS AS MyCustomGeneratedValue(),
     --                    ^^^^^^^^^^^^^^^^^^^


Of course, I could use:
CREATE TABLE Client (
     CreatedBy varchar(30) DEFAULT MyCustomGeneratedValue(),
     --                    ^^^^^^^

But, unlike other defaults, with GENERATED ALWAYS, the user cannot 
insert a value directly into, or update, the generated value.

Best regards,
Sylvain

-- 
Website: http://www.chicoree.fr



Mime
View raw message