Replies: 2 comments 2 replies
-
|
Hi, I probably need to rework a doc I've written on the topic The first SQl in your post- If you were to change the SQL to- SELECT MediaID, MediaPath, MediaFile, MediaType then the collation sequence is required since the request is to order the output To get this new query to work without RMNOCASE, one must override its use by- SELECT MediaID, MediaPath, MediaFile, MediaType the "collate nocase' clause is placed to the right of the column name in every another example- SELECT MediaID, MediaPath, MediaFile, MediaType Depending on the data in the tables, the results may differ between collation The second SQL in the post is different since it modifies the data. Whenever SQLite modifies data, it updates any indexes associated with that data. and since the MultimediaTable was defined as- the MediaFile column's default collation is RMNOCASE, so the index will also use Therefore any change in MediaFile will update the index which uses RMNOCASE. I don't think there is a way to override the update of an index. Let me stop here to see if this is clear so far. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, I understand. In general, if sorting, doing a specific select upon, or updating a COLLATE RMNOCASE column, then qualify the column name with COLLATE NOCASE. I did not do this recently when changing the value of MediaFile for many rows in the MultimediaTable. It appears that nothing bad happened. But I'll play it safe in the future. Yes, I do have backups. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In https://github.com/RichardOtter/Genealogy-scripts/tree/main/RM/Run%20SQL#readme , it is recommended that "SQLite built-in NOCASE collation" be used in queries in which the column is "TEXT COLLATE RMNOCASE" type. How would these two queries be changed?
SELECT MediaID, MediaPath, MediaFile, MediaType from MultimediaTable;
UPDATE MultimediaTable SET MediaFile='$MediaFile' WHERE MediaID=$MediaID ;
MediaPath is TEXT type
MediaFile is TEXT COLLATE RMNOCASE type
Beta Was this translation helpful? Give feedback.
All reactions