You're not deleting any rows, you're just changing the value of the data in the 
row.

What you probably want is something like

DELETE FROM BC WHERE PK = '%q';

HTH

Andy Ling


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Ali Dorri
Sent: Wed 30 August 2017 12:19
To: SQLite mailing list
Subject: Re: [sqlite] Issue with updating database content (C++)

Hi,

Thanks, now it works and removes all except for the PK. How can I remove
the PK then? i.e. what is the correct way of doing the following?
   UPDATE BC set Signature = null ,    PK = null   where PK = '%q' ;

Another issue I have is that when I remove these entries, the size of the
database does not decrease. I do the VACUUM after the program, but it does
not work and the size of the database does not decrease while the data are
removed.
Can anyone help me in this regard?

Thanks

On Wed, Aug 30, 2017 at 8:49 PM, Clemens Ladisch <clem...@ladisch.de> wrote:

> Ali Dorri wrote:
> > I encode the PKs to base64
> > [...]
> > The PK is a BLOB type, i.e.,
> >    sql = "CREATE TABLE BC("  \
> >                 "PK            BLOB    ," \
>
> Why do you store a text value in a blob field?
>
> > "UPDATE BC set Signature = null  and PK = null   where PK = '%q' ;
>
> That does not update the PK column.
>
>    UPDATE BC set Signature = null ,    PK = null   where PK = '%q' ;
>                                   ^^^^
>
> Regards,
> Clemens
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
---------------------------------------------------------------------------------------
This email has been scanned for email related threats and delivered safely by 
Mimecast.
For more information please visit http://www.mimecast.com
---------------------------------------------------------------------------------------

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to