A Adilson Jacinto Active Member Licensed User Longtime User Sep 24, 2015 #1 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 : Code: Copy 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
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 : Code: Copy 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
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2015 #2 Not sure that I understand. Can you post the code that is not working? Upvote 0
A Adilson Jacinto Active Member Licensed User Longtime User Sep 25, 2015 #3 Erel said: Not sure that I understand. Can you post the code that is not working? Click to expand... @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
Erel said: Not sure that I understand. Can you post the code that is not working? Click to expand... @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?
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2015 #4 It is not really related to RDC. You can add NULL to the SQL command. Upvote 0
A Adilson Jacinto Active Member Licensed User Longtime User Sep 25, 2015 #5 Erel said: It is not really related to RDC. You can add NULL to the SQL command. Click to expand... 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
Erel said: It is not really related to RDC. You can add NULL to the SQL command. Click to expand... 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(?,?,"")
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2015 #6 Yes. You need to set the values of all columns. There is no such thing as "no value". The value can be NULL or an empty string, but there must be some value. Upvote 0
Yes. You need to set the values of all columns. There is no such thing as "no value". The value can be NULL or an empty string, but there must be some value.
A Adilson Jacinto Active Member Licensed User Longtime User Sep 25, 2015 #7 Erel said: Yes. You need to set the values of all columns. There is no such thing as "no value". The value can be NULL or an empty string, but there must be some value. Click to expand... Thanks @Erel Upvote 0
Erel said: Yes. You need to set the values of all columns. There is no such thing as "no value". The value can be NULL or an empty string, but there must be some value. Click to expand... Thanks @Erel