Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TMS table name

TMS field name

CSpace field name

notes

ConXrefs

constituentID

previousOwner

reference to Person or Organization

ConXrefs

remarks

ownershipNote

 

TextEntries

textEntry

ownershipNote

where textTypeID is 93

sql query

view: cs_previousowners (refreshed 2012-03-12) (NEEDS UPDATE)

Code Block
sql
sql
SELECT
 CAST(o.objectID AS VARCHAR) objectID,
 x.constituentID previousOwner,
 x.remarks ownershipNote
FROM
 ConXrefs x
 JOIN roles r ON x.roleID = r.roleID
 JOIN objects o ON x.ID = o.objectID
WHERE
 x.tableID = 108
 AND x.active = 1
 AND o.IsVirtual = 0 AND o.IsTemplate = 0
 AND lower(r.ROLE) IN ('original owner', 'previous owner', 'previous donor (to other museum)')
UNION ALL
SELECT
 CAST(o.objectID AS VARCHAR) objectID,
 NULL previousOwner,
 t.TextEntry ownershipNote
FROM
 TextEntries t
 JOIN Objects o ON t.ID = o.objectID
 JOIN TextTypes tt ON t.TextTypeID = tt.TextTypeID
WHERE
 t.tableID = 108
 AND o.IsVirtual = 0 AND o.IsTemplate = 0
 AND t.TextTypeID = 93
;

notes

  • should Role field be imported? (it distinguishes "owners" from "previous donors")