RE: Serial Column (workaround found)
Posted in 2001
Yes, SERIAL can be use (as an input field) in a lookup
form (i assume that you meant a form generated using
the ISQL;Form;Generate function).
However, my intention is to allow the user to key in a
value in the SERIAL feild (during INPUT) so that they
can UPDATE the record. Instead of keying in multiple
keys, the user could just enter the value of that
SERIAL field (since the SERIAL value is unique).
Initial insertion of the record was done somewhere.
Anyway, I have found my work-around of using a
declared variable of an INTEGER type instead of using
SERIAL type in the program.
Example shown below:
----------------
table1
field_1 SERIAL,
field_2 CHAR(10),
field_3 CHAR(4),
field_4 ......
-----------------
MAIN
...
DEFINE var1 INTEGER
DEFINE t_table1 RECORD LIKE table1.*
INPUT BY NAME var1
AFTER FIELD var1
... some statement
SELECT * INTO t_table1.* FROM table1
WHERE field_1 = var1
IF status = 0 THEN
UPDATE table1
SET table1.* = t_table1
WHERE field_1 = var1
END IF
-------------------
Thanks for responding.
Richard
--- Robert Stuart <Robert.Stuart@NFER-NELSON.co.uk>
wrote:
> Yes - I didn't know there was any doubt about it -
> the old form4gl program
> places ALL fields into forms.
>
> Are you using the serial as a lookup in your form?
> Or as data creation?
>
> If you are only looking up data then it's great.
> If you are creating data by overriding serial then -
> why use serial?
>
> In general, I do not publish serial to end users,
> simply use serials as
> [part of] a primary key.
>
> -----Original Message-----
> From: R WS [mailto:bquop@yahoo.com]
> Sent: 12 January 2001 01:08
> To: informix-list@iiug.org
> Subject: Serial Column
>
>
> Dear All,
>
> Can a column with SERIAL data type be used in a form
> as an INPUT field ?
>
> Thanks in advance.
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/