-- SQL Server 200 Code
-- Create a table with a bigint in it
--
create table mybigint (i int, b bigint)
insert into mybigint (i, b) values (1, 1234567890)
// PowerBuilder Code Snippet
// Attempt to retrieve the bigint into a longlong
//
longlong b
SELECT b into :b from mybigint where i = 1 using sqlca ;
messagebox("b = ", string(b))
--> What appears in the messagebox is the number 4050765991979987505
Yet, when I use a decimal to do the select, and then assign the decimal to a
longlong, it works fine...
// PowerBuilder Code - using a decimal as a temporary variable
//
decimal d
longlong b
SELECT b into :d from mybigint where i = 1 using sqlca ;
b = d
messagebox("b = ", string(b))
--> Now I get the number 1234567890
Any ideas?
I'm hoping NOT to move to the latest build of PowerBuilder, as that will
significantly increase our test cycle (whenever we change versions of either
PowerBuilder or our database, we go through a full blown test cycle, as
opposed to testing those componants that have changed).
Thanks,
Len
I'm using an ODBC interface to SQL Server, version 2000.81.9042.00
"Len Binns" <bi...@buffalo.nospam.edu> wrote in message
news:4249856f$1@forums-1-dub...
I updated the SQL 2000 driver (was version 2000.81.9042.00) to a later
version (version 2000.85.1022.00).
It's just slightly newer than the one I was using.
That corrected the problem, so it appears to be a driver issue.
"Len Binns" <bi...@buffalo.nospam.edu> wrote in message
news:42498635$1@forums-1-dub...
The following snippet still produces garbage, and I've now found/downloaded
the newest driver.
// PowerBuilder Code Snippet
// Attempt to retrieve the bigint into a longlong
//
longlong b
SELECT b into :b from mybigint where i = 1 using sqlca ;
messagebox("b = ", string(b))
"Len Binns" <bi...@buffalo.nospam.edu> wrote in message
news:42498d36$1@forums-1-dub...
Thanks for confirming it is indeed a problem, I'll submit it to Sybase.
As for workarounds, it looks like I have two:
1) Using a decimal as an intermediate storage container, and
2) Using a datawindow
Thanks for the tip on the latter. Between these two workarounds, I should
be able to proceed. If you think of any others, or more importantly if you
see a reason I shouldn't use a decimal as an intermediate value, please let
me know.
Thanks again for your response.
-Len
"Scott Morris" <bo...@bogus.com> wrote in message
news:42499739$1@forums-1-dub...
"Len Binns" <bi...@buffalo.nospam.edu> wrote in message
news:42499c88$1@forums-1-dub...
I came up with this "dumbed down" example to help illustrate the problem in
its simplest form and make it easy for someone to reproduce.
"Scott Morris" <bo...@bogus.com> wrote in message
news:4249a78b@forums-1-dub...
Mike Kruchten
"Len Binns" <bi...@buffalo.nospam.edu> wrote in message
news:4249acc4$1@forums-1-dub...
On 30 Mar 2005 07:24:02 -0800, "Mike Kruchten" <m...@fsisolutions.com>
wrote:
Mike Kruchten
"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
news:g43m41tmqha8ugr84...@4ax.com...
"Mike Kruchten" <m...@fsisolutions.com> wrote in message
news:424b2eff$1@forums-2-dub...