iOS Question RDC mysql table insert record

Adilson Jacinto

Active Member
Licensed User
Longtime User
Hi there,

I cannot believe this is taking me forever to figure it out, basically I am trying to insert a new record to the table using RDC.

So in my config.properties I have the following

sql.insert_record=INSERT INTO CountRecordsCustomers (SalonId,CountedRec) VALUES(?,?)

then in my code I have :

B4X:
Dim cmd1 As DBCommand
cmd1.Initialize
cmd1.Name = "insert_record"
cmd1.Parameters = Array As Object(dSalon, "1")
DBrequestmanager1.ExecuteCommand(cmd1, "")

The above works fine, but if I add a new column to the table, it won't work any more (The requested URL was not found on this server). It seems like I need to include the new column there in the query, but if this is a SQL command I only should pass what I want to insert in the table without adding the new column to the command.

Is there a way to do so?

Thanks
 

Adilson Jacinto

Active Member
Licensed User
Longtime User
Not sure that I understand. Can you post the code that is not working?

@Erel the problem is not the code but if I add a new column to the table that's when it stops working.

Let us look at the Table "CountRecordsCustomers " and it has two columns "SalonId" and "CountedRec" now I have add a new column to the table and don't include in the sql stament then the error accurs. But I don't want to add the new column to the sql statement because I don't to insert any data in that column.

Does it make sense now?
 
Upvote 0

Adilson Jacinto

Active Member
Licensed User
Longtime User
It is not really related to RDC.

You can add NULL to the SQL command.

But at that point is not NULL because I am not even including in the SQL command.

So does that mean I need to include the column thre even though I'm not going to pass any value?

I mean like this sql.insert_record=INSERT INTO CountRecordsCustomers (SalonId,CountedRec,Test) VALUES(?,?,"")
 
Upvote 0
Top