Can someone post an example of a table creation with an autoinc
primary key? The autoinc has to be a 4 byte integer. I know the syntax
for other back-ends but not for Informix. Also, what the equivalent
for the following data types? :
Integer(4 byte)
SmallInt(2 byte integer)
TinyInt(1 byte Integer)
VARCHAR(cstring)
NVARCHAR(text)
TIA
Carlos San Miguel
↪ replying to Carlos San Miguel
Carlos San Miguel wrote:
> Can someone post an example of a table creation with an autoinc
> primary key? The autoinc has to be a 4 byte integer. I know the syntax
> for other back-ends but not for Informix.
Data type SERIAL - insert zero to allocate a number (or omit the
column from the insert statement).
Alternatively, in IDS 9.40, use SEQUENCES (a la DB2 and Oracle).
Also, what the equivalent
> for the following data types? :
RTF(abulous)M?
> Integer(4 byte)
INTEGER
> SmallInt(2 byte integer)
INTEGER
> TinyInt(1 byte Integer)
SMALLINT CHECK(colname BETWEEN -127 AND +127)
-- you choose which asymmetric value you want - +128 or -128?
> VARCHAR(cstring)
What's the cstring about?
VARCHAR(n) for 1 <= n <= 255
> NVARCHAR(text)
What's the text about?
NVARCHAR(n) for 1 <= n <= 255
Both VARCHAR and NVARCHAR have minimum allocation options - RTFM.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/