Skip site navigation (1) Skip section navigation (2)


From: tövis <tovises(at)freemail(dot)hu>
To: "pgsql novice" <pgsql-novice(at)postgresql(dot)org>,"Jan B(dot)" <jan(at)monso(dot)de>
Subject: Re: "NOT NULL"
Date: 2005-05-24 12:40:00
Message-ID: 008c01c5605d$b306a7b0$3401a8c0@mainxp (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Excuse me! - I always ask these kind of questions about nice, reusable and 
forgottable english abbreviation.
Rapid Application Development - for me it is Clarion which is based on 
standard templates, it is support many kind of database types, has its own 
drivers, and of course ODBC. SQL also supported but native drivers only 
exists for commercial versions such as MS-SQL Prevasive, Informix...
That I working through ODBC driver, and suppose to use ready to work 
templates for update/insert/delete and browse tables, but such a tool its 
covering and completelly hide the ODBC/SQL surface. It is also object 
oriented and I cannot give string value for an integer (especially if its 
length only 4 byte instead of 7 characzter such as 'DEFAULT'). This is why I 
use a CSTRING in database definition for Clarion and ODBC driver, and it is 
working well for insert and fetch records, but I could npot figure out how 
to give partial definition to SQL server. I need a server side solution, to 
change default behavior - of course if this is possible.

----- Original Message ----- 
From: "Jan B." <jan(at)monso(dot)de>
To: "tövis" <tovises(at)freemail(dot)hu>
Cc: "pgsql novice" <pgsql-novice(at)postgresql(dot)org>
Sent: Tuesday, May 24, 2005 12:54 PM
Subject: Re: [NOVICE] "NOT NULL"

> 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:
> 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
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>      joining column's datatypes do not match

In response to


pgsql-novice by date

Next:From: peter nkosiDate: 2005-05-24 15:13:10
Previous:From: Bendik Rognlien JohansenDate: 2005-05-24 12:33:53
Subject: Re: [despammed] Trigger unhappy

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group