So I have a Sqlite table [Customers]
and a column [CustomerId]
which is a Guid
but as there is no Guid
type in sqlite I have saved it as binary
so I thought I could use the statement:
delete from [Customers] where [CustomerId] ='|����8B�����\�'
where |����8B�����\�
is my binary representation in my Sqlite explorer, but this returns
(0) Rows Affected
How can I delete a row based on my Id
column which is effectively a Guid
There are two way of using binary data:
use a blob literal:
DELETE FROM Customers WHERE CustomerId = x'1234AB...'
use parameters:
guid = ...
sql = "DELETE FROM Customers WHERE CustomerId = ?"
db.execute(sql, [guid])