Re: On columns with default ___ not null
Posted in 1993
In <CAMxuH.AyK@vcd.hp.com> kenm@vcd.hp.com (Ken Miles) writes: >Why doesn't this work? >I create a table with a column spec something like the following: > part_number char(12) default " " not null, >The description from the SQL Reference manual suggests that the default >will be put into the column on an insert if I don't specify anything >but this is not always what happens. In an ISQL form I get the message >"column .. does not allow nulls". This is presumably because Perform 4.1 does not know about DEFAULT constraints (which were new in 5.0). Perform 5.0 (hopefully) should fix this, in the meantime you should use DEFAULT attributes in your foms as well. > A similar thing happens in ESQL/C if >the variable for the column is NULL. This is correct behaviour. You specified that NULLs should be disallowed. > In ISQL Query it does work if I >don't mention the part_number column in an insert statement but this isn't >an option in an ISQL form which needs to display the column field. >Is this a bug or feature? I'm not sure it qualifies as either. graeme -- Disclaimer: The author's opinions are his own, and not necessarily those of Pyramid Technology Ltd. or Pyramid Technology Inc. --------------------------------------------------------------------------- -m------- Graeme Sargent Voice: +44 (0)252 373035 ---mmm----- Senior Database Consultant Fax : +44 (0)252 373135 -----mmmmm--- Pyramid Technology Ltd. Telex: Tell who??? -------mmmmmmm- Farnborough, Hants GU14 7PL Email: graeme@pyra.co.uk --------------------------------------------------------------------------- We have the technology. The tricky bit is learning how to use it.