Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!pyramid!infmx!aland
From: aland@infmx.UUCP (Dr. Scump)
Newsgroups: comp.databases
Subject: Re: Informix 4gl forms - formonly syntax broken
Summary: doc error?
Message-ID: <465@infmx.UUCP>
Date: 24 Sep 88 06:40:18 GMT
References: <475@pan.UUCP> <1363@ucsfcca.ucsf.edu>
Organization: Informix Software Inc., Menlo Park, CA.
Lines: 51

In article <1363@ucsfcca.ucsf.edu>, brianc@daedalus (Brian Colfer) writes:
> 
> Well I tried this effect... The LIKE works fine I think JW's confusion
> on this is not reading the manual quite carefully enough:
> 
> fieldtag = FORMONLY.field-name
>   [TYPE [ data-type | LIKE table.column] ] [NOT NULL] [, attributes];
>         ^                              ^
> So this works:
> 
> database test
> ...
> f1 = formonly.foo type like test_tbl.col_one;
> 
> but maybe I'm missing something because this doesn't:
> 
> database test
> ...
> f1 = formonly.foo type like test_tbl.col_one not null;
> If it is a bug... maybe '.03 release has the fix ... just got it 
> this morning.

I think it's a documentation error.  Since NOT NULL is part of the 
column type, it shouldn't be used with a LIKE.  I think that this syntax:

  fieldtag = FORMONLY.field_name
     [TYPE [data_type | LIKE table.column]] [NOT NULL] [,attr_list];
                                            ^^^^^^^^^^
should read:

  fieldtag = FORMONLY.field_name
     [TYPE [data_type [NOT NULL] | LIKE table.column]] [,attr_list];
                      ^^^^^^^^^^

I tested this to make sure.  If you define a formnly field LIKE a
column and that column is NOT NULL, the formonly field properly picks
up the NOT NULL characteristic.  If you define a formonly field LIKE
a column that allows nulls, the formonly field likewise allows nulls.
If you omit the whole TYPE entry, the field type defaults to CHAR.

> Brian    : UC San Francisco       :...!{ucbvax,uunet}!daedalus.ucsf.edu!brianc 
> Colfer   : Dept. of Lab. Medicine : brianc@daedalus.ucsf.edu 
>          :  PH. 415-476-2325      : BRIANC@UCSFCCA.BITNET

P.S.: nice example of space/null management in your previos posting...

-- 
 Alan S. Denney  |  Informix Software, Inc.  |  {pyramid|uunet}!infmx!aland
 Disclaimer: These opinions are mine alone.  If I am caught or killed,
             the secretary will disavow any knowledge of my actions.
 Santos' 4th Law: "Anything worth fighting for is worth fighting *dirty* for"