Java Question DBRequestManager update multiple records

Status
Not open for further replies.

santiago

Member
Licensed User
Longtime User
Hello,
I have this problem I am not able to found the right sentence


I have a database db with 3 fields (fieldA,fieldB,fieldC)

sql.update=UPDATE db set fieldA=?,fieldB=? where fieldC=?
sql.update1=UPDATE db set fieldA=?,fieldB=? where fieldc in (?)


If I use
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "update"
cmd.Parameters = Array As Object(ValueA,ValueB,ValueC) ..... with ValueC="12345" (a string)
reqManager.ExecuteCOMMAND(cmd,"iG1")

This command its working fine

But if I use
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "update1"
cmd.Parameters = Array As Object(ValueA,ValueB,ValueC) .... with ValueC="'12345','12445','23333'" (a string)
reqManager.ExecuteCOMMAND(cmd,"iG2")

DO NOT UPATE ... but not error found

I would like to execute SQL command UPDATE db set fieldA='123',fieldB='234' where fieldC in ('234','235','236')

Please,
Could anyone help me?
I thanks you for your help and your time
 

OliverA

Expert
Licensed User
Longtime User
B4X:
sql.update1=UPDATE db set fieldA=?,fieldB=? where fieldc in (?, ?, ?)

B4X:
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "update1"
cmd.Parameters = Array As Object(ValueA,ValueB, "12345", "12445" ,"23333")
reqManager.ExecuteCOMMAND(cmd,"iG2")
 
Status
Not open for further replies.
Top