can't use "default" in ISQL
Posted in 1994
jack@cc wrote:
> when I writes:
> create table a_table
> ( table_item1 char(10),
> table_item date default today
> ) ^^^^^^^^^^^^^
> in ISQL,it displays a syntex error message.
> but the manual says it works,what's wrong?
> any comment will be appreciated!
The DEFAULT syntax only works in the FORMS environment, i.e it is a
funtion of sperform rather than ISQL, and for a very good reason - when
entering data through forms you can see what you're doing and confirm or
change the default value as appropriate. I can't see what use a built-in
default value would have.
If you want to change all existing NULL values to a default, just use
UPDATE tablename set columnname=default WHERE columname is null
** Opinions expressed are my own and not necessarily those of my employer
=========================================================================
Barry Toomey Phone +353-1-2822333
AT&T Network Systems Ireland Fax +353-1-2822864
Corke Abbey Avenue, email: bt@irl3b2c.att.com
Bray, uunet: att!irl3b2c!bt
Co. Dublin
Ireland
=========================================================================