|
|
sybperl-l Archive
Up Prev Next
From: Steve Coleman - SEWP <scoleman at sewp dot nasa dot gov>
Subject: Re: Sybperl question
Date: Jan 19 1996 2:12PM
Excerpts from what Ivan Simon said:
|
|I have a question about sybperl.
|
|Sometimes Sybase generates IDENTITY numbers that are very large,
|18 digits long. This is too long for sybperl and perl to handle
|as an integer and so they are converted to exponential notation
|when they are returned from sybase to perl throught sybperl.
|
|I would like to catch these values as strings on the perl side
|without changing the sybase stored procedure that returns them.
|(Do a convert(varchar(20),inst_id) in the stored procedure).
|
|Any suggestions as to how I can do this.
1) if the table will not grow too large you can change the precision
for the identity field when you create the table.
create table MyTable (
my_id numeric(9,0) identity,
.
.
.
)
go
The unfortunate part is you need to recreate the table.
2) If you must use a stored procedure and you can't modify the tables
then you can call it from another 'wrapper' stored procedure that does
your convert(varchar,my_id) for you.
|
|Thanks,
|
|Ivan.
|
|--
|----------------------------------------------------------------------
|Ivan Simon.
|Algorithmics Incorporated, 822 Richmond St. W., 3rd Floor.
|Toronto, Ontario, Canada, M6J 1C9.
|TEL: (416)703-0898 ext. 242, FAX: (416)703-0767, ivan@algorithmics.com
|----------------------------------------------------------------------
|
|
Steve Coleman -- scoleman@sewp.nasa.gov
vox: 301.286.7636 fax: 301.286.1619
|