Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: use MTB_ISOcode for language field values

...

Code Block
sql
sql
SELECT
 o.objectID,
 o.objectName,
 NULL objectNameLanguage,
 NULL objectNameNote
FROM
 Objects o
WHERE
 o.IsVirtual = 0 AND o.IsTemplate = 0
UNION ALL
SELECT
 'c' + CAST(c.componentID AS VARCHAR) objectID,
 c.componentName objectName,
 NULL objectNameLanguage,
 NULL objectNameNote
FROM
 ObjComponents c
WHERE
 c.objectID IN (SELECT t.objectID FROM ObjComponents t GROUP BY t.objectID HAVING count(*) > 1)
 AND c.componentName IS NOT NULL
UNION ALL
SELECT 
 c.objectID,
 c.componentName objectName,
 NULL objectNameLanguage,
 'Component name' objectNameNote
FROM
 ObjComponents c 
 JOIN Objects o ON c.objectID = o.objectID
WHERE
 o.IsVirtual = 0 AND o.IsTemplate = 0
 AND c.objectID IN (SELECT t.objectID FROM ObjComponents t GROUP BY t.objectID HAVING count(*) = 1)
 AND c.componentName IS NOT NULL
 AND coalesce(o.objectName,'') != c.componentName
UNION ALL
SELECT
 n.objectID,
 n.objectName,
 (CASE WHEN n.languageID != '0' THEN l.languageMTB_ISOcode END) objectNameLanguage,
 (CASE WHEN n.objectNameTypeID != '0' THEN t.objectNameType ELSE '' END) + (CASE WHEN n.objectNameTypeID != '0' AND n.remarks is not null THEN '; ' ELSE '' END) + coalesce(n.remarks, '') objectNameNote
FROM
 objectNames n
 LEFT OUTER JOIN objectNameTypes t ON n.objectNameTypeID = t.objectNameTypeID
 LEFT OUTER JOIN languages l ON n.languageID = l.languageID
WHERE
 n.objectName IS NOT NULL
;

...

  • TODO: change objectNameLanguage from static term list to vocabulary-controlled listTODO: translate controlled list options for objectNameLanguage field (current options do not match up)

Brief Descriptions extract

...

view: cs_objecttitles

Code Block
sql
sql
SELECT

 objectID,

 title,
  (CASE WHEN n.languageID != '0' THEN l.languageMTB_ISOcode END) titleLanguage,

 (CASE WHEN n.titleTypeID != '0' THEN t.titleType ELSE '' END) titleType
FROM

 objTitles n

 LEFT OUTER JOIN titleTypes t ON n.titleTypeID = t.titleTypeID

 LEFT OUTER JOIN languages l ON n.languageID = l.languageID
;

...

  • "remarks" field has only a few entries, which can be updated manually after data migration, per Michael (12/15/11)
  • TODO: change titleLanguage from static term list to vocabulary-controlled listTODO: translate controlled list options for titleLanguage field (current options do not match up)
  • TODO: update options for titleType field

...