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


Reply via email to