Simon, thank you for your reply.


Unfortunately as a novice I’m still struggling to find a construct that will do 
what I want.

Reading the on-line SQLite guide to the UPDATE statement:



“If the UPDATE statement does not have a WHERE clause, all rows in the table 
are modified by the UPDATE.”



I was hoping that the command:



UPDATE folder

    SET Folder_Path = 'E:\Photos'



would change the directory references in all existing 16 rows currently 
containing Folder_Path references to the wrong locations to the correct 
location ‘E:\Photos’ however this also generates a “UNIQUE constraint failed” 
error.



I also downloaded the SQLite CLI tool and tried to execute the command 
".schema" but received the error “unable to open database” when trying to open 
the file. (The file opens without problems using the application ‘DB Browser 
for SQLite’).



I have now managed to upload the file to my Google drive and it’s accessible 
via the following link:



https://drive.google.com/open?id=191LBKrl7hA7OR2HUUFbFnU71lF9X9uoo



Examining ‘Table -> Folder’ shows the 16 rows containing the incorrect folder 
paths all of which now need to point to ‘E:\Photos’



Kind regards,

Carlo.







________________________________
From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> on behalf of 
Simon Slavin <slav...@bigfraud.org>
Sent: Thursday, December 6, 2018 9:22:35 PM
To: SQLite mailing list
Subject: Re: [sqlite] Updating Folder_Path in Windows 10 Photos App

On 6 Dec 2018, at 9:01pm, Carlo capaldo <carlocapa...@hotmail.com> wrote:

> UNIQUE constraint failed: Folder.Folder_Path:

You seem to have two rows in the table: one with the correct Folder_Path and 
one with the incorrect Folder_Path.  So instead of an UPDATE you just need a 
DELETE command like

DELETE FROM folder
    WHERE Folder_Path = 'C:\Users\carlo\Pictures'
    AND folder_Id = 1

However, please check by eye to make sure I've understood the situation 
correctly, before you execute the above DELETE command.

If it's not obvious whether this is the right thing to do, then using the 
SQLite CLI tool, execute the command ".schema" and paste the resulting text 
into a reply to this thread.

Simon.
_______________________________________________
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

Reply via email to