i am using Xojo 2019 r3
I am trying to fetch data from my mysql databse.
i faced a strange case where i am getting wrong value for one column.
When i checked column it is set as unsigned zero fill. i am getting same value for every row, other columns are getting fetched correctly.
Here is my code to fetch data.
sql = "SELECT * from "+ TableName + " WHERE COUpdate = ‘1’
rs =app.db.SQLSelect(sql)
I tried by specifying column names in query but no luck.
What do you mean exactly when you write you get wrong values from this column?
What values do you expect, what values do you get and how do you handle the RecordSet Field Values?
let take a example
i have following data in my table
CalEvent Title COUpdate
000071 Test 1
so now i am using MysqlCommunityServer object (app.db) to retrieve data.
sql = "SELECT * from "+ TableName + " WHERE COUpdate = 1
rs =app.db.SQLSelect(sql)
strData = rs.Field("CalEvent ).StringValue
but i am getting strData as ‘57’
Title is fetching correctly as ‘Test’
Not worked.
i used following
strData1 = Str( rs.Field( “CalEvent” ).IntegerValue )
strData2 = Str( rs.Field( “CalEvent” ).DoubleValue )
strData3 = rs.Field( “CalEvent” ).StringValue
and got wrong data 57 instead 71 in all three conditions
Then i altered a table, Removed my column’s Unsigned and ZeroFill attribute then it returns correct data(71) for all the above 3 conditions even for .StringValue
so i think there should be a bug somewhere
Please let me know if anyone faced same issue and know how can i access Unsigned column. i need it unsigned as it is being used from long time.
Possible explanation of what’s happening: I assume the mySQLCommunityServer Plugin expects a SIGNED value (maybe that’s why there’s no UIntegerValue Type for DatabaseColumns?) and thus does a false convert to 57?