/* RM5copyMetadataToImageFileExifToolArgList.sql
*/
SELECT 
  '-Caption-Abstract='  
  ||
  REPLACE(CAST(RM.Caption AS TEXT),x'0D0A','.') 
  || ' ' ||
  REPLACE(CAST(RM.Description AS TEXT),x'0D0A','.')
  || CAST(X'0D0A' AS TEXT) ||
  RM.MediaPath 
  || 
  RM.MediaFile
  || CAST(X'0D0A' AS TEXT) ||
  '-execute' || Pic.ROWID
  || CAST(X'0D0A' AS TEXT)
    AS Args
FROM MultiMediaTable AS RM
  INNER JOIN PicasaTable AS Pic 
  ON RM.MediaFile COLLATE NOCASE = Pic.MediaFile
WHERE 
  (RM.Caption IS NOT NULL OR RM.Description IS NOT NULL)
  AND 
  (Pic.Caption LIKE '-' AND Pic.Description LIKE '-')
;


