dbTalk Databases Forums  

Global autoincrement is out of range

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Global autoincrement is out of range in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fantom
 
Posts: n/a

Default Global autoincrement is out of range - 11-21-2007 , 09:12 AM






Hi
I use database where globalid = 10 and one column is global autoincrement
and this type is bigint. Now i can't adding record to this table because i
get error - "value 42949674157 out of range destination" ! Why ?
This value is inside range for this globalid

Fantom



Reply With Quote
  #2  
Old   
Nick Elson
 
Posts: n/a

Default Re: Global autoincrement is out of range - 11-21-2007 , 11:14 AM






Is it possible you have a trigger on that table
that is doing something else with that value?

Otherwise please show your specific information,
-versions
-create table statement
-failing insert statement [use `-zr sql+hostvars`]
-the database registered option [select db_property( 'GlobalDBID ')]
-the current range of values in the table:
select max(<gbl_incr_column_name> ) from table;

"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto> wrote

Quote:
Hi
I use database where globalid = 10 and one column is global autoincrement
and this type is bigint. Now i can't adding record to this table because i
get error - "value 42949674157 out of range destination" ! Why ?
This value is inside range for this globalid

Fantom




Reply With Quote
  #3  
Old   
Fantom
 
Posts: n/a

Default Re: Global autoincrement is out of range - 11-22-2007 , 03:15 AM



Quote:
Is it possible you have a trigger on that table
that is doing something else with that value?
i dont have trigers

Quote:
Otherwise please show your specific information,
-versions
10.0.1.3579
-create table statement
CREATE TABLE "DBA"."Kasa" (
"Kwota" "smallmoney" NOT NULL
,"Opis" varchar(100) NOT NULL
,"DataKasa" timestamp NOT NULL
,"Typ" smallint NOT NULL
,"ID_Magazyn" smallint NOT NULL
,"NrDokument" integer NULL
,"ID_Kasa" integer NOT NULL DEFAULT global
autoincrement
,"ID_Remote" bigint NOT NULL DEFAULT global
autoincrement
,PRIMARY KEY ("ID_Remote")
)

ALTER TABLE "DBA"."Kasa" ADD UNIQUE ( "ID_Kasa" )

ALTER TABLE "DBA"."Kasa"
ADD FOREIGN KEY "Magazyn" ("ID_Magazyn")
REFERENCES "DBA"."Magazyn" ("ID_Magazyn")

Quote:
-failing insert statement [use `-zr sql+hostvars`]
-the database registered option [select db_property( 'GlobalDBID
')]
10
-the current range of values in the table:
select max(<gbl_incr_column_name> ) from table;
from 42949672961 to 42949674148

Before i use ASA8. Now i convert this to ASA10. I set SET OPTION
PUBLIC.Global_database_id = 10.

When i want adding this record in Sybase central thi is work.
When i want

Fantom

Quote:
"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto> wrote in message
news:47444ae7 (AT) forums-1-dub (DOT) ..
Hi
I use database where globalid = 10 and one column is global autoincrement
and this type is bigint. Now i can't adding record to this table because
i get error - "value 42949674157 out of range destination" ! Why ?
This value is inside range for this globalid

Fantom






Reply With Quote
  #4  
Old   
Fantom
 
Posts: n/a

Default Re: Global autoincrement is out of range - 11-22-2007 , 12:16 PM



Sorry. I find problem. I use stored procedure where
I use
1) Insert Into .....
2) select @@identity into @ID_Kasa

@ID_Kasa is integer and in table exists two column with autoincrement (see
bottom). I want return value from column ID_Kasa but ASA10 return last value
of autoincrement - ID_Remote (bigint).
How i may get easy and fast last generated ID_Kasa ??

Fantom


Quote:
Is it possible you have a trigger on that table
that is doing something else with that value?

i dont have trigers

Otherwise please show your specific information,
-versions
10.0.1.3579
-create table statement

CREATE TABLE "DBA"."Kasa" (
"Kwota" "smallmoney" NOT NULL
,"Opis" varchar(100) NOT NULL
,"DataKasa" timestamp NOT NULL
,"Typ" smallint NOT NULL
,"ID_Magazyn" smallint NOT NULL
,"NrDokument" integer NULL
,"ID_Kasa" integer NOT NULL DEFAULT global
autoincrement
,"ID_Remote" bigint NOT NULL DEFAULT global
autoincrement
,PRIMARY KEY ("ID_Remote")
)

ALTER TABLE "DBA"."Kasa" ADD UNIQUE ( "ID_Kasa" )

ALTER TABLE "DBA"."Kasa"
ADD FOREIGN KEY "Magazyn" ("ID_Magazyn")
REFERENCES "DBA"."Magazyn" ("ID_Magazyn")

-failing insert statement [use `-zr sql+hostvars`]
-the database registered option [select db_property( 'GlobalDBID
')]
10
-the current range of values in the table:
select max(<gbl_incr_column_name> ) from table;
from 42949672961 to 42949674148

Before i use ASA8. Now i convert this to ASA10. I set SET OPTION
PUBLIC.Global_database_id = 10.

When i want adding this record in Sybase central thi is work.
When i want

Fantom

"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto> wrote in message
news:47444ae7 (AT) forums-1-dub (DOT) ..
Hi
I use database where globalid = 10 and one column is global
autoincrement and this type is bigint. Now i can't adding record to this
table because i get error - "value 42949674157 out of range destination"
! Why ?
This value is inside range for this globalid

Fantom








Reply With Quote
  #5  
Old   
Nick Elson
 
Posts: n/a

Default Re: Global autoincrement is out of range - 11-22-2007 , 12:23 PM



Two Global Autoincrments? 1 just an INTEGER?
I wonder if that is a causitive factor. It not often
one has a need to have to autoincrements on the
same table (global or not).

No problem running that here ... well past your
value. But then again I don't have your foreign
key definition since I don't have the other
table ("Magazyn") or data in that.



"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto> wrote

Quote:
Is it possible you have a trigger on that table
that is doing something else with that value?

i dont have trigers

Otherwise please show your specific information,
-versions
10.0.1.3579
-create table statement

CREATE TABLE "DBA"."Kasa" (
"Kwota" "smallmoney" NOT NULL
,"Opis" varchar(100) NOT NULL
,"DataKasa" timestamp NOT NULL
,"Typ" smallint NOT NULL
,"ID_Magazyn" smallint NOT NULL
,"NrDokument" integer NULL
,"ID_Kasa" integer NOT NULL DEFAULT global
autoincrement
,"ID_Remote" bigint NOT NULL DEFAULT global
autoincrement
,PRIMARY KEY ("ID_Remote")
)

ALTER TABLE "DBA"."Kasa" ADD UNIQUE ( "ID_Kasa" )

ALTER TABLE "DBA"."Kasa"
ADD FOREIGN KEY "Magazyn" ("ID_Magazyn")
REFERENCES "DBA"."Magazyn" ("ID_Magazyn")

-failing insert statement [use `-zr sql+hostvars`]
-the database registered option [select db_property( 'GlobalDBID
')]
10
-the current range of values in the table:
select max(<gbl_incr_column_name> ) from table;
from 42949672961 to 42949674148

Before i use ASA8. Now i convert this to ASA10. I set SET OPTION
PUBLIC.Global_database_id = 10.

When i want adding this record in Sybase central thi is work.
When i want

Fantom

"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto> wrote in message
news:47444ae7 (AT) forums-1-dub (DOT) ..
Hi
I use database where globalid = 10 and one column is global
autoincrement and this type is bigint. Now i can't adding record to this
table because i get error - "value 42949674157 out of range destination"
! Why ?
This value is inside range for this globalid

Fantom








Reply With Quote
  #6  
Old   
Fantom
 
Posts: n/a

Default Re: Global autoincrement is out of range - 11-22-2007 , 01:25 PM



Quote:
Two Global Autoincrments? 1 just an INTEGER?
I wonder if that is a causitive factor. It not often
one has a need to have to autoincrements on the
same table (global or not).
Yes. This is old column before i start write moblikink synhc. I dont
remove/change this in database and aplication.

Fantom

Quote:
No problem running that here ... well past your
value. But then again I don't have your foreign
key definition since I don't have the other
table ("Magazyn") or data in that.



"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto> wrote in message
news:474548a3$1 (AT) forums-1-dub (DOT) ..
Is it possible you have a trigger on that table
that is doing something else with that value?

i dont have trigers

Otherwise please show your specific information,
-versions
10.0.1.3579
-create table statement

CREATE TABLE "DBA"."Kasa" (
"Kwota" "smallmoney" NOT NULL
,"Opis" varchar(100) NOT NULL
,"DataKasa" timestamp NOT NULL
,"Typ" smallint NOT NULL
,"ID_Magazyn" smallint NOT NULL
,"NrDokument" integer NULL
,"ID_Kasa" integer NOT NULL DEFAULT global
autoincrement
,"ID_Remote" bigint NOT NULL DEFAULT global
autoincrement
,PRIMARY KEY ("ID_Remote")
)

ALTER TABLE "DBA"."Kasa" ADD UNIQUE ( "ID_Kasa" )

ALTER TABLE "DBA"."Kasa"
ADD FOREIGN KEY "Magazyn" ("ID_Magazyn")
REFERENCES "DBA"."Magazyn" ("ID_Magazyn")

-failing insert statement [use `-zr sql+hostvars`]
-the database registered option [select db_property( 'GlobalDBID
')]
10
-the current range of values in the table:
select max(<gbl_incr_column_name> ) from table;
from 42949672961 to 42949674148

Before i use ASA8. Now i convert this to ASA10. I set SET OPTION
PUBLIC.Global_database_id = 10.

When i want adding this record in Sybase central thi is work.
When i want

Fantom

"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto> wrote in message
news:47444ae7 (AT) forums-1-dub (DOT) ..
Hi
I use database where globalid = 10 and one column is global
autoincrement and this type is bigint. Now i can't adding record to
this table because i get error - "value 42949674157 out of range
destination" ! Why ?
This value is inside range for this globalid

Fantom










Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.