Android Question RDC query

santiago

Member
Licensed User
Longtime User
I am using RDC . Its working fine and fast.

But I do not know how to solve this query "select * from table where var1 in ('x1','x2',....'xn') and var2=0

I spent time testing several ways but I found nothing working .Allways server send me a null answer

In the configuration file I wrote
sql.valres1=SELECT valres FROM ticket where ticket in (?) and valres=0

I fetch the call with the parameter a= 'x1','x2','x3' , a is a string variable WITH the query conditions
NOT SUCCESS

I fetch the call with a="('x1','x2','x3') " changing to
sql.valres1=SELECT valres FROM ticket where ticket in ? and valres=0
NOT SUCCESS

I changed to send a="x1,x2,x3" and not success too

I use this block of code to call and execute the query.Its is working fine with other queries.

Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "valres1"
cmd.Parameters = Array As Object(A)
reqManager.ExecuteQuery(cmd,0,"tm")

Please could you tell me how I must send the query?
Thanks for your time an d help
 

santiago

Member
Licensed User
Longtime User
Beg your pardon if you think I did not search the forum for this problem.

I read the 247 post inside www.b4x.com/android/forum/threads/remote-database-connector-rdc-connect-to-any-remote-db.31540/page-13
But my problem is the parameters can vary from 2 to x , x<15
At least I can built 15 configuration lines for se SELECT but I think it would be a fix for this issue .

By the way, i read something about call a database strored procedure, but while I used stored procedures , I did not understand the proposal or directive described for a solution. Please could somebody explain?

Thanks
 
Upvote 0

santiago

Member
Licensed User
Longtime User
Erel,
Thanks for your fast response.
I spent time tonigh and I found this solution working for me , and I think working for everyone .I will share if someone needed

In the configuration file :
sql.valres2=SELECT valres FROM ticket where FIND_IN_SET(ticket ,?)

I sent the parameter in a text variable with the format "x1,x2,...xn" not "'x1','x2',.

I tested it and works

Again, thanks
 
Upvote 0
Top