myschema SERIAL(-2147403719) syntax error
Posted in 2000
Topics: Storage & Space Management
I'm trying to use myschema to move a database from SCO to Sun. The SCO box is running 7.31. When I run myschema on SCO it generates all SERIAL fields with -2147403719 {Curr: 1}. I compiled myschema using the SCO dev kit. Thanks Gary Quiring CREATE TABLE "informix".syscolatt ( tabname CHAR(18), colname CHAR(18), seqno SERIAL(-2147403719) {Curr: 1} NOT NULL, color SMALLINT, inverse CHAR(1), underline CHAR(1), blink CHAR(1), left CHAR(1), def_format CHAR(64), condition CHAR(64) ) IN data2dbs EXTENT SIZE 8 NEXT SIZE 8 LOCK MODE ROW; CREATE TABLE "informix".csxpiles ( piles_serial_id SERIAL(-2147403719) {Curr: 1} NOT NULL, tabname CHAR(20), tabrowid INTEGER
"Gary Quiring" <garyq@emcosales.com> wrote in message
news:pZj0OXoMlKgDHlebFe7ccBJ8EQnT@4ax.com...
> I'm trying to use myschema to move a database from SCO to Sun. The
SCO box
> is running 7.31. When I run myschema on SCO it generates all SERIAL
fields
> with -2147403719 {Curr: 1}. I compiled myschema using the SCO dev
kit.
The value looks like the two's complement of 79929 (32 bits decimal).
>
> Thanks
> Gary Quiring
>
>
> CREATE TABLE "informix".syscolatt (
> tabname CHAR(18),
> colname CHAR(18),
> seqno SERIAL(-2147403719) {Curr: 1} NOT NULL,
> color SMALLINT,
> inverse CHAR(1),
> underline CHAR(1),
> blink CHAR(1),
> left CHAR(1),
> def_format CHAR(64),
> condition CHAR(64)
> ) IN data2dbs EXTENT SIZE 8 NEXT SIZE 8 LOCK MODE ROW;
>
> CREATE TABLE "informix".csxpiles (
> piles_serial_id SERIAL(-2147403719) {Curr: 1} NOT NULL,
> tabname CHAR(20),
> tabrowid INTEGER
>
>
The Informix Migration Guide says (IDS 7.30, p.11-47):
The SERIAL fields included in CREATE TABLE statements that dbschema
displays do not specify a starting value. New SERIAL fields created with
the
schema file have a starting value of 1, regardless of their starting
value in the
original database. If this value is not acceptable, you must modify the
schema
file.
So, if the start value of 1 is OK for you, just go ahead.
HTH
--
Christian Knappke
The opinions stated above are my own and not necessarily those of my
employer.
On Mon, 23 Oct 2000 20:13:19 GMT, Gary Quiring <garyq@emcosales.com> wrote: >I'm trying to use myschema to move a database from SCO to Sun. The SCO box >is running 7.31. When I run myschema on SCO it generates all SERIAL fields >with -2147403719 {Curr: 1}. I compiled myschema using the SCO dev kit. > >Thanks >Gary Quiring > I switched the makefile to use ESQL and it now works fine. I originally compiled it using C4GL. Gary Q
If you do not specify the -a flag or the -m flag, or if you are running myschema against a 5.xx or SE server, then myschema gets the next serial number using: SELECT max(serial_column_name) FROM tablename; and adds '1' to the result. If run against an IDS server, and -a or -m are included, myschema gets the next serial number from the table's sysptnhdr record and ... AAAAAHHHHHHHH!!!!!!!!! Bug alert! I just spotted a bug in the code. Oops. Thanks Gary. Under separate cover find a new copy of myschema.ec with the repair. That or a version of it will be in the next release. Art S. Kagel Gary Quiring wrote: > > I'm trying to use myschema to move a database from SCO to Sun. The SCO box > is running 7.31. When I run myschema on SCO it generates all SERIAL fields > with -2147403719 {Curr: 1}. I compiled myschema using the SCO dev kit. > > Thanks > Gary Quiring > > CREATE TABLE "informix".syscolatt ( > tabname CHAR(18), > colname CHAR(18), > seqno SERIAL(-2147403719) {Curr: 1} NOT NULL, > color SMALLINT, > inverse CHAR(1), > underline CHAR(1), > blink CHAR(1), > left CHAR(1), > def_format CHAR(64), > condition CHAR(64) > ) IN data2dbs EXTENT SIZE 8 NEXT SIZE 8 LOCK MODE ROW; > > CREATE TABLE "informix".csxpiles ( > piles_serial_id SERIAL(-2147403719) {Curr: 1} NOT NULL, > tabname CHAR(20), > tabrowid INTEGER
OK, I have send an update to Walt and he will install it as soon as he can after the convention. This includes a fix to the bug that Gary noticed and also a new option -c to improve control of which value (serialv or max(col)+1) is used in the create statement. Art S. Kagel "Art S. Kagel" wrote: > > If you do not specify the -a flag or the -m flag, or if you are running > myschema against a 5.xx or SE server, then myschema gets the next serial > number using: > > SELECT max(serial_column_name) > FROM tablename; > > and adds '1' to the result. If run against an IDS server, and -a or -m are > included, myschema gets the next serial number from the table's sysptnhdr > record and ... > > AAAAAHHHHHHHH!!!!!!!!! Bug alert! I just spotted a bug in the code. Oops. > Thanks Gary. Under separate cover find a new copy of myschema.ec with the > repair. That or a version of it will be in the next release. > > Art S. Kagel > > Gary Quiring wrote: > > > > I'm trying to use myschema to move a database from SCO to Sun. The SCO box > > is running 7.31. When I run myschema on SCO it generates all SERIAL fields > > with -2147403719 {Curr: 1}. I compiled myschema using the SCO dev kit. > > > > Thanks > > Gary Quiring > > > > CREATE TABLE "informix".syscolatt ( > > tabname CHAR(18), > > colname CHAR(18), > > seqno SERIAL(-2147403719) {Curr: 1} NOT NULL, > > color SMALLINT, > > inverse CHAR(1), > > underline CHAR(1), > > blink CHAR(1), > > left CHAR(1), > > def_format CHAR(64), > > condition CHAR(64) > > ) IN data2dbs EXTENT SIZE 8 NEXT SIZE 8 LOCK MODE ROW; > > > > CREATE TABLE "informix".csxpiles ( > > piles_serial_id SERIAL(-2147403719) {Curr: 1} NOT NULL, > > tabname CHAR(20), > > tabrowid INTEGER