Changes

Jump to: navigation, search

Duplicate CDF

990 bytes added, 10:49, 3 July 2015
no edit summary
This query checks for Duplicate CDFs according to {{IMSMANG}} rulesi.e. unique name (including spaces), data type per parent.
<pre>
PostgreSQL
SELECT
"public".customdefinedfield."name","public".customdefinedfield.cdf_datatype,"public".customdefinedfield.entitytype,Count("public".customdefinedfield.cdf_id)
FROM
"public".customdefinedfield
GROUP BY
"public".customdefinedfield."name","public".customdefinedfield.cdf_datatype,"public".customdefinedfield.entitytype
HAVING
Count("public".customdefinedfield.cdf_id) > '1'
ORDER BY
customdefinedfield.entitytype ASC1,customdefinedfield.name ASC2
</pre>
{{Warning| Depending on data type, etc. there might '''not''' be any error messages during the Staging area generation.}}This query checks for Duplicate CDFs based only on name in lower case andlength 63. If you get any duplicates here, you need to double-check that the Staging area database is created correctly.
<pre>
PostgreSQL
SELECT
left(lower("public".customdefinedfield."name"), 63) AS max_length,"public".customdefinedfield.entitytype,Count("public".customdefinedfield.cdf_id)
FROM
"public".customdefinedfield
GROUP BY
customdefinedfield.namemax_length,"public".customdefinedfield.entitytype
HAVING
Count("public".customdefinedfield.cdf_id) > '1'
ORDER BY
customdefinedfield.entitytype ASC1,customdefinedfield.name ASC2
</pre>
{{Warning| Depending on data type, etc. there might '''not''' be any error messages during the Staging area geo generation.}}This query checks for Duplicate CDFs based only on name in lower case and length 31. If you get any duplicates here, you need to double-check that the Staging area geo database is created correctly and the column names used in the geo views are not confusing. <pre>PostgreSQLSELECTleft(lower("public".customdefinedfield."name"), 31) AS max_length,"public".customdefinedfield.entitytype,Count("public".customdefinedfield.cdf_id)FROM"public".customdefinedfieldGROUP BYmax_length,"public".customdefinedfield.entitytypeHAVINGCount("public".customdefinedfield.cdf_id) > 1ORDER BY1, 2</pre>
{{NavBox Upgrade}}
[[Category:NoPublic]]
[[Category:SQL Queries]]
6,632
edits

Navigation menu