Hi
did anyone tried a update function like that before ? , it does not work here
where the set column and value is a variable ?
" sql.insert_cols1=UPDATE 030_electrode SET ?=? WHERE EE_Electrode_Name = ? "
error
"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 ''EE_Holder_DispZ'='0.0000' WHERE EE_Electrode_Name = 'el-001-r'' at line 1"
thank you now i have to find a way how to update 108 colums by reading a xml file with RDC
it is working this way
it looks like i cannot pass the same command to the rdc
B4X:
Sub checkupload1(stringx As String,namex As String)
If stringx.Length>0 Then
Log("here fail")
sql1.ExecNonQuery("UPDATE ELECTRODE SET " & namex & nn & " ='"& stringx &"'" & "WHERE EE_Electrode_Name='" & parsql.Replace(".xml","") &"'" )
Log("here" & namex)
Else
Log("nothing here" & namex)
End If
Return
End Sub
RDC
B4X:
Dim cmd As DBCommand
cmd.Initialize
cmd.name ="insert_cols1"
Dim sv As String
sv="UPDATE electrode SET " & colx & " = " & Chr(39) & colv & Chr(39) & " " & " WHERE EE_Electrode_Name = " & Chr(39) & valx & Chr(39)
Log(sv)
cmd.Parameters=Array As Object(sv)
the log(sv) is ok
UPDATE electrode SET EE_Spark_EndPosC = '270.000' WHERE EE_Electrode_Name = 'el-008-r'
and it works if you copy and paste in the sql Query
sql.insert_cols1=?;
B4X:
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 ''UPDATE electrode SET UNIT = \'in\' WHERE EE_Electrode_Name = \'el-008-r\'' at line 1
it add's "\" to the command EE_Electrode_Name = \'el-008-r\'