Serial field value range?
Posted in 2003
Topics: General Discussion
Hi Everyone, In Visual FoxPro, our Integer field datatype can range from -2147483647 to 2147483647 What is the range for the Informix Serial field datatype? Also, has it changed at all between v7 and v9 of Informix. Thanks. -- William Fields MCSD - Microsoft Visual FoxPro MCP - Win2k Pro US Bankruptcy Court Phoenix, AZ The secret to creativity is knowing how to hide your sources. - Albert Einstein
"William Fields" <Bill_Fields@azb.uscourts.gov> wrote in message news:bctmg4$nkb$1@apollo.nyed.circ2.dcn... > Hi Everyone, > > In Visual FoxPro, our Integer field datatype can range from -2147483647 to > 2147483647 > > What is the range for the Informix Serial field datatype? Also, has it > changed at all between v7 and v9 of Informix. The serial field of informix also has the same range like Visual Foxpro. However in v9, you can use serial8, which has maximum value of 4611686018427387905 (2^63 -1). To access and manipulate serial8 field is bit of a pain since its native structure is not directly compliant with long long. However there is another way of accessing serial8 field, which I posted few days back.
rkusenet wrote: > "William Fields" <Bill_Fields@azb.uscourts.gov> wrote: >>In Visual FoxPro, our Integer field datatype can range from -2147483647 to >>2147483647 >> >>What is the range for the Informix Serial field datatype? Also, has it >>changed at all between v7 and v9 of Informix. > > > The serial field of informix also has the same range like Visual Foxpro. Yes, and No. Yes, you can store negative values in a SERIAL column, but you have to insert them explicitly. No, you cannot get a zero into a SERIAL column. [If you really cheat hard, you can create an INTEGER column, put a zero into it, then alter it to SERIAL.] The automatically generated serial values are 1..2^31-1, after which the values wrap; they are always positive. The range of SERIAL has not changed since Informix SQL 1.10; in fact, even the pre-SQL product used the same range for SERIAL columns. > However in v9, you can use serial8, which has maximum value of > 4611686018427387905 (2^63 -1). And the zero and negative values are subject to the same rules as SERIAL. > To access and manipulate serial8 field is bit of a pain since its native > structure is not directly compliant with long long. However there is another > way of accessing serial8 field, which I posted few days back. That's a polite understatement. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Jonathan Leffler wrote: > rkusenet wrote: >> "William Fields" <Bill_Fields@azb.uscourts.gov> wrote: >>>In Visual FoxPro, our Integer field datatype can range >>> from -2147483647 to >>>2147483647 >>> >>>What is the range for the Informix Serial field datatype? >>> Also, has it >>>changed at all between v7 and v9 of Informix. >> >> The serial field of informix also has the same range like >> Visual Foxpro. > > Yes, and No. Yes, you can store negative values in a SERIAL column, > but you have to insert them explicitly. No, you cannot get a zero > into a SERIAL column. [If you really cheat hard, you can create an > INTEGER column, put a zero into it, then alter it to SERIAL.] The > automatically generated serial values are 1..2^31-1, after which the > values wrap; they are always positive. > > The range of SERIAL has not changed since Informix SQL > 1.10; in fact, > even the pre-SQL product used the same range for SERIAL columns. > >> However in v9, you can use serial8, which has maximum value of > > 4611686018427387905 (2^63 -1). > > And the zero and negative values are subject to the same > rules as SERIAL. > >> To access and manipulate serial8 field is bit of a pain >> since its native >> structure is not directly compliant with long long. >> However there is another >> way of accessing serial8 field, which I posted few days back. > > That's a polite understatement. Inserting -ve value in a serial column causes error in few utilities especially if you are using SQL Editor. -Ganesan. -- Direct access to this group with http://web2news.com http://web2news.com/?comp.databases.informix To contact in private, remove nno2spp-2a+3m