Android Question Variable table name through jRDC

Status
Not open for further replies.

yiankos1

Well-Known Member
Licensed User
Longtime User
I have a mySQL server that creates daily a new table according to daily date. So i use this code:

Android code:
B4X:
    cmd.Initialize
    cmd.Name = "selectAll"
'Parameters for table name
    cmd.Parameters = Array As Object("01_01_2017","01_01_2017")
    reqManager.ExecuteQuery(cmd,0,"selectAll")

config file
B4X:
sql.selectAll=SELECT * FROM daily.? WHERE daily.?.agms=265475

I get error setting "?" for variable table name
B4X:
<pre>    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;&apos;01_01_2017&apos; WHERE daily.&apos;01_01_2017&apos;.agms=265475&apos; at line 1</pre></p>

My question is how can i set a mySQL command for a variable table name.
Thank you for your time.
 

azzam223

Active Member
Licensed User
Longtime User
Did add items to array or not ?

If didn't then you must add it maybe the error is because you did not add items as Oliver say

I assume that you added the items to array if not then you must add it
 
Upvote 0

marconotsopolo

Member
Licensed User

Hi

I am sorry to post a question so late on from this original post, but how do you populate the new array prior to the re-dim. Would you have any code example so that I may better understand this process, as this fits my current problem exactly.

Thanks and apologies again..
Mark
 
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…