Mysql max integer value

Want to talk about something that isn't covered by another category?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
adamlevine
Posts: 1
Joined: Fri Apr 06, 2018 6:11 am

Mysql max integer value

Post by adamlevine » Fri Apr 06, 2018 6:16 am

Mysql max integer value

Hi!

Here is part of my code:
(it's on desktop app, button action)

dim rs as RecordSet
dim i, fim as integer

rs=app.g_db.SQLSelect("select max(id) id from zendesk")
fim=rs.field("id").IntegerValue+1
here is the "debug of fim"

fim = -14163
and, of course, this is the "select max(id) id from zendesk" result from my database…
id= 51372

… any idea what's going on here??

bogs
Posts: 2402
Joined: Sat Feb 25, 2017 10:45 pm

Re: Mysql max integer value

Post by bogs » Fri Apr 06, 2018 6:55 am

… any idea what's going on here??
Yes, your dimensioning 3 variables in a basic dialect (looks like RB/Xojo), and pulling one column. Perhaps you posted on the wrong forum?
Image

SparkOut
Posts: 1827
Joined: Sun Sep 23, 2007 4:58 pm

Re: Mysql max integer value

Post by SparkOut » Fri Apr 06, 2018 8:10 am

Whatever language, 65535-14163=51372

The correct value of the 16bit integer is being retrieved, there is just a problem with interpreting it as a signed or unsigned value.

Post Reply

Return to “Off-Topic”