Link Orphans: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
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..."
 
No edit summary
 
Line 7: Line 7:
SELECT
SELECT
"public".link.approval_state,
"public".link.approval_state,
"public".link.from_guid,
"public".link.from_link_type,
"public".link.from_link_type,
"public".link.to_link_type,
"public".link.to_link_type,
Line 27: Line 28:
ORDER BY
ORDER BY
"public"."location".location_localid ASC
"public"."location".location_localid ASC
</pre>
==Case Items linking to other than Location orphans==__NOEDITSECTION__
The items that was approved to these items do not exist in the database anymore. The items 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_guid,
"public".link.from_link_type,
"public".link.to_link_type,
"public".link.system_link,
"public".link.to_link_is_version,
"public".link.data_entry_date,
"public".link.update_type
FROM
"public".link
WHERE
"public".link.from_guid IS NULL AND
"public".link.to_link_type <> 'LOCATION'
</pre>
</pre>
[[Category:SQL Queries]]
[[Category:SQL Queries]]
[[Category:NoPublic]]
[[Category:NoPublic]]
{{NavBox Hub}}
{{NavBox Hub}}

Latest revision as of 16:09, 17 April 2017

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

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.

SELECT
"public".link.approval_state,
"public".link.from_guid,
"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

Case Items linking to other than Location orphans

The items that was approved to these items do not exist in the database anymore. The items that have the orphans opens without any error messages so I do not think these orphans must be deleted from the database.

SELECT
"public".link.approval_state,
"public".link.from_guid,
"public".link.from_link_type,
"public".link.to_link_type,
"public".link.system_link,
"public".link.to_link_is_version,
"public".link.data_entry_date,
"public".link.update_type
FROM
"public".link
WHERE
"public".link.from_guid IS NULL AND
"public".link.to_link_type <> 'LOCATION'

Template:NavBox Hub