victormedranop Well-Known Member Licensed User Longtime User Nov 5, 2019 #1 hi i,m trying to get a varbinary record from a microsoft sql server. Connection works ok, but here is my problem i got this error com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of the varchar value '02200000160' overflowed an int column. he is my code Code: rs = sql1.ExecQuery($"select * from XX where XXXX = ${XX}"$) Log($"select * from FOTOS where Cedula = ${cedula}"$) Log(rs.ColumnCount) Do While rs.NextRow ----------> the error start here Dim buffer() As Byte buffer = rs.GetBlob("Imagen") Loop Any help will be apreciated Victor
hi i,m trying to get a varbinary record from a microsoft sql server. Connection works ok, but here is my problem i got this error com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of the varchar value '02200000160' overflowed an int column. he is my code Code: rs = sql1.ExecQuery($"select * from XX where XXXX = ${XX}"$) Log($"select * from FOTOS where Cedula = ${cedula}"$) Log(rs.ColumnCount) Do While rs.NextRow ----------> the error start here Dim buffer() As Byte buffer = rs.GetBlob("Imagen") Loop Any help will be apreciated Victor
K keirS Well-Known Member Licensed User Longtime User Nov 5, 2019 #2 Need to know more information than that. What type is cedula in B4x and what type is Cedula in SQL Server? It is true that the value of 2200000160 is of greater size than the maximum value of an Int column in SQL server which is 2147483647 . Upvote 0
Need to know more information than that. What type is cedula in B4x and what type is Cedula in SQL Server? It is true that the value of 2200000160 is of greater size than the maximum value of an Int column in SQL server which is 2147483647 .
victormedranop Well-Known Member Licensed User Longtime User Nov 5, 2019 #3 its a string, for index, the column i'am accessing is in sql server and it's a varbinary type (an image). Victor Upvote 0
its a string, for index, the column i'am accessing is in sql server and it's a varbinary type (an image). Victor
rraswisak Active Member Licensed User Longtime User Nov 5, 2019 #4 if XXXX data type was string then i think you miss apostrophe in your where syntax, it should be: Code: rs = sql1.ExecQuery($"select * from XX where XXXX = '${XX}' "$) sorry not tested Upvote 0
if XXXX data type was string then i think you miss apostrophe in your where syntax, it should be: Code: rs = sql1.ExecQuery($"select * from XX where XXXX = '${XX}' "$) sorry not tested
Erel B4X founder Staff member Licensed User Longtime User Nov 6, 2019 #5 It should be: Code: rs = sql1.ExecQuery2($"select * from XX where XXXX = ?"$, Array As String(XX)) Upvote 0
victormedranop Well-Known Member Licensed User Longtime User Nov 6, 2019 #6 i found my problem. using web service in b4j Code: srvr.AddHandler("/imagen", "ConsultaImagen", False) i need to initialize the sql.ini in main class, not in the class ConsultaImagen. when i did that works like expected, thanks. Upvote 0
i found my problem. using web service in b4j Code: srvr.AddHandler("/imagen", "ConsultaImagen", False) i need to initialize the sql.ini in main class, not in the class ConsultaImagen. when i did that works like expected, thanks.