Source Comments
Quote from Roger1938 on 2020-11-13, 1:54 pmI have several sources that have comments.
Is there a sql that would append these comments to the source Research Notes? If not could someone give me a start?
Roger
I have several sources that have comments.
Is there a sql that would append these comments to the source Research Notes? If not could someone give me a start?
Roger
Uploaded files:Quote from thejerrybryan on 2020-11-13, 9:00 pmYou are looking for something like the following.
UPDATE CitationTable
SET ActualText = ActualText || Comments;SQLite does not have a CONCAT() function. Rather, it uses || as the concatenation operator.
You might want to add a WHERE clause to make the SET statement conditional on the Comments field not being NULL, but I doubt the performance would really be any faster. You also might want to concatenate in some white space between the ActualText and the Comments - blanks or carriage returns - except that your example of Comments already has leading carriage returns so additional white space is probably not required if all your Comments fields are set up like this one.
Jerry
You are looking for something like the following.
UPDATE CitationTable
SET ActualText = ActualText || Comments;
SQLite does not have a CONCAT() function. Rather, it uses || as the concatenation operator.
You might want to add a WHERE clause to make the SET statement conditional on the Comments field not being NULL, but I doubt the performance would really be any faster. You also might want to concatenate in some white space between the ActualText and the Comments - blanks or carriage returns - except that your example of Comments already has leading carriage returns so additional white space is probably not required if all your Comments fields are set up like this one.
Jerry
Quote from Roger1938 on 2020-11-14, 6:34 amThanks Jerry
So far: The only problem is some of my Citations have no ActualText but just Comments. This causes a blank line at the top so I will have to fix that.
SELECT ActualText, Comments FROM CitationTable WHERE Comments <> ‘’;
UPDATE CitationTable
SET ActualText = TRIM(ActualText) || char(13) || TRIM(Comments), Comments = ‘’;
Thanks Jerry
So far: The only problem is some of my Citations have no ActualText but just Comments. This causes a blank line at the top so I will have to fix that.
SELECT ActualText, Comments FROM CitationTable WHERE Comments <> ‘’;
UPDATE CitationTable
SET ActualText = TRIM(ActualText) || char(13) || TRIM(Comments), Comments = ‘’;