Changes

Link Orphans

1,389 bytes added, 16:53, 17 April 2017
Created page with "{{TOC right}} All Actions (New, Replace, Combine, Save, Approve, Unlink, etc.) creates different types of rows and different number of rows in the table ''link''. Orphans indi..."
{{TOC right}}
All Actions (New, Replace, Combine, Save, Approve, Unlink, etc.) creates different types of rows and different number of rows in the table ''link''. Orphans indicate that the data has been deleted with SQL but not all rows.

==Case Items linking to Location orphans==__NOEDITSECTION__
The items that was approved to these Locations do not exist in the database anymore. The Locations that have the orphans opens without any error messages so I do not think these orphans must be deleted from the database.
<pre>
SELECT
"public".link.approval_state,
"public".link.from_link_type,
"public".link.to_link_type,
"public"."location".location_localid,
"public"."location".locationname,
"public".gazetteer.gazetteername,
"public".gazetteerlevel."level",
"public".link.system_link,
"public".link.to_link_is_version,
"public".link.update_type,
"public".link.data_entry_date,
"public".link.data_enterer
FROM
"public".link
INNER JOIN "public"."location" ON "public".link.to_guid = "public"."location".location_guid
INNER JOIN "public".gazetteer ON "public"."location".gazetteer_guid = "public".gazetteer.gazetteer_guid
INNER JOIN "public".gazetteerlevel ON "public".gazetteer.gazlevel_guid = "public".gazetteerlevel.gazlevel_guid
WHERE
"public".link.from_guid IS NULL
ORDER BY
"public"."location".location_localid ASC
</pre>
[[Category:SQL Queries]]
[[Category:NoPublic]]
{{NavBox Hub}}
6,632
edits