Hello,
Let's say for the key "x" I have value "y". If I want to change the value from y to z , I use kvs.put(x,z) but this add the key to last position on kvs. For example if i use kvs.listykeys previous to this , x key is at second position but after this it changes to last position. Is there anyway to to avoid this ? like editing the key instead of removing and adding again without changing the list sequence ?
like adding a edit public sup to keyvalue store as it is in put :
and use update ?
I am trying to add this to kvs :
I dont understand how to use question marks here. What I want to do is Execute :
Update main set key=value where key=key
TY
Let's say for the key "x" I have value "y". If I want to change the value from y to z , I use kvs.put(x,z) but this add the key to last position on kvs. For example if i use kvs.listykeys previous to this , x key is at second position but after this it changes to last position. Is there anyway to to avoid this ? like editing the key instead of removing and adding again without changing the list sequence ?
like adding a edit public sup to keyvalue store as it is in put :
B4X:
Public Sub Put(Key As String, Value As Object)
sql1.ExecNonQuery2("INSERT OR REPLACE INTO main VALUES(?, ?)", Array As Object(Key, ser.ConvertObjectToBytes(Value)))
End Sub
and use update ?
I am trying to add this to kvs :
B4X:
Public Sub Edit(Key As String, Value As Object)
sql1.ExecNonQuery2("UPDATE main SET(?, ?)", Array As Object(Key, ser.ConvertObjectToBytes(Value)))
End Sub
I dont understand how to use question marks here. What I want to do is Execute :
Update main set key=value where key=key
TY
Last edited: