Android Question Get field type from resultset


Well-Known Member
Licensed User
I use JdbcResultSet to read data from SQL database, I'm making a search dialog box to filter data, i want to add quotes to search-criteria according to its type like

if field.type = text then
      strSearch = ("'" & value & "'" )
      strSearch = (value)
end if

I tried IsNumber function, but when searching for phone number(text field) it returns true, so i can not add quotes in this case!!
I think about adding check box to let user select if this Value is real number like unit-price, or if it is text, like phone-number!

any ideas how solve this problem?


Licensed User
Consider to use SQL prepared statement. You don’t need to worry about the quotes. :)
Upvote 0


Licensed User
i tried to put the quotes in both cases, i think it works ,
If you want to preserve the double quotes as part of the string, always use Smart Strings. Here it is:
Dim value As String = "Mostez"
    Dim strSearch As String= $""${value}""$
    Log(strSearch)   'displays: "Mostez"
I hope this is in line with what you are trying to achieve. If not, ditch.
Upvote 0