PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: IDENTITY Columns
Date: Oct 7 1998 1:28PM

Brad Dietrich writes:
 > I have a numeric data column with an IDENTITY constraint.  After several
 > days, I noticed that the identity numbers the
 > database was producing were huge (e.g. 100000000000016).  For some
 > reason sybase decided to jump from 6432 to
 > 100000000000001 for the identity numbers.  The real problem arose when
 > ctlib in perl returned scientific notation for the
 > identity number causing me to lose the last digit and thus nolonger
 > having a unique number.  How do you stop sybase from
 > producing these huge numbers, or make ctlib return an integer
 > representation of this number?

You've been hit by the 'burning set'... Your server was shutdown
either with the machine going down hard or with a 'shutdown with
no_wait'. Because the server pre-allocates identity numbers (for
performance reasons) when it crashes it doesn't know how many it has
used, so it assumes that the whole previous 'burn set' has been used
up. The burn set is a configuration param, and is discussed in several 
places in the Sybase manuals. Talk to your DBA about this issue.

WRT Sybperl converting large numeric values to float is probably not a 
good idea. You can work around this temporarily by setting
$dbh->{UseNumeric} = 1 which will retrieve numeric values and keep
them in native format, converting them to strings when they are
printed out, and using Sybase cs_calc() calls to do arithmetic on
them.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com