autonumber key in informix?
Posted in 1999
Topics: General Discussion
hi all: I am using a flat file to build a index table. I am going to build a numerical unique index field that other table can refer to. Is there a autonumber field in informix like in access or do I have to produce the unquie key index everytime myself? thanks. yan
Create your table with a serial field as the unique key and ensure that your
flat file has a zero in the field that is going to be inserted into the
serial field
e.g.
SQL Create table code:-
CREATE TABLE table1
( uniq_key serial,
field2 char(10),
etc...
);
Flat ASCII file:-
0|test_txt1|field3|field4|field5 etc...
0|test_txt2|field3|field4|field5 etc...
0|test_txt3|field3|field4|field5 etc...
0|test_txt4|field3|field4|field5 etc...
This will ensure that each row inserted into the table1 table will have a
unique key.
Hope this helps
Sean
Yan Zhu wrote in message <789vd7$l7e$1@news.xmission.com>...
>
>
>hi all:
> I am using a flat file to build a index table. I am going to build a
>numerical unique index field that other table can refer to. Is there a
>autonumber field in informix like in access or do I have to produce the
>unquie key index everytime myself?
> thanks.
>yan
>
>