Re: Script Example
Posted in 2004
Topics: Data Types & Schema Design, Versions, Editions & End-of-Life
Thanks Jonathan, I do not have a manual. I'm doing this for a customer
how is in another city. His IS people weren't mucho help that is why I
posted the question here.
The variable nvarchar(n) is this for strings over 255 characters? The
way you put it it seems that varchar and nvarchar are for strings not
over 255 characters.
Also, is this syntax correct for creating an index ?
Create table table1
(col1 serial primary key not null,
col2 ...,
.... ...,
);
and last, is Serial a 4 byte integer.
TIA
Carlos San Miguel
Jonathan Leffler <jleffler@earthlink.net> wrote in message news:<BXnfc.11014$A_4.7783@newsread1.news.pas.earthlink.net>...
> 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.
Carlos San Miguel wrote: > Thanks Jonathan, I do not have a manual. I'm doing this for a customer > how is in another city. His IS people weren't mucho help that is why I > posted the question here. The following link will get you to the manuals: http://www.ibm.com/informix/pubs/library/lists.html See the IBM Informix Guide to SQL: Reference for a description of data types. See the IBM Informix Guide to SQL: Syntax for a description of syntax. -- June Hunt