From: | "Jan B(dot)" <jan(at)monso(dot)de> |
---|---|
To: | tövis <tovises(at)freemail(dot)hu> |
Cc: | pgsql novice <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: "NOT NULL" |
Date: | 2005-05-24 10:54:03 |
Message-ID: | 429307CB.3060100@monso.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
If your RAD (I don't know what this means at all) does not allow the
keyword "DEFAULT" you might probably use this:
INSERT INTO some_table (second_field_name, third_field_name) VALUES
(second_field_value, third_field_value);
If you not mention first_field_name in the first parenthesis, the
default value will be used.
The reference for INSERT can give you further syntax details:
http://www.postgresql.org/docs/8.0/interactive/sql-insert.html
Jan Behrens
tövis wrote:
> Problem is evolving;o(
>
> When I'm using a sequence for table PRIMARY KEY, where I never ever
> want to give a value myself to this field I've should provide DEFAULT
> expression...
> INSERT INTO some_table VALUES (DEFAULT,second_field,third_field,...);
> But my lovely RAD (Clarion 6.1) does not allow this because of the
> type is a LONG - INTEGER (4 byte).
> I found a simple work around, define for RAD this value as STRING(16)
> - and I can give value 'DEFAULT' - it is working.
> Is there possibility to define for server that if it gets NULL or ZERO
> value for this field use default value - next from sequence - which is
> work well if you does not define "NOT NULL" or "PRIMARY KEY"
> constraint for this field?
> Thanks in advance
> Tövis
>
From | Date | Subject | |
---|---|---|---|
Next Message | Bendik Rognlien Johansen | 2005-05-24 12:33:53 | Re: [despammed] Trigger unhappy |
Previous Message | tövis | 2005-05-24 10:37:54 | Re: "NOT NULL" |