Forum

Forum breadcrumbs - You are here:ForumGeneral: Chit-chatSource Comments
Please or Register to create posts and topics.

Source Comments

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:
  • Screen-Shot-2020-11-13-at-1.52.16-PM.png

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

kevync has reacted to this post.
kevync

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 = ‘’;