Changes

Jump to: navigation, search

Duplicate CDF

946 bytes added, 10:57, 3 July 2015
no edit summary
This query checks for Duplicate CDFs according to {{IMSMANG}} rules i.e. unique name (including spaces), data type per parent.
<pre>
MySQL
SELECT
customdefinedfield.name,
customdefinedfield.cdf_datatype,
customdefinedfield.entitytype,
Count(customdefinedfield.cdf_id)
FROM
customdefinedfield
GROUP BY
customdefinedfield.name,
customdefinedfield.cdf_datatype,
customdefinedfield.entitytype
HAVING
Count(customdefinedfield.cdf_id) > '1'
ORDER BY
customdefinedfield.entitytype ASC,
customdefinedfield.name ASC
 
PostgreSQL
SELECT
This query checks for Duplicate CDFs based only on name in lower case and length 63. If you get any duplicates here, you need to double-check that the Staging area database is created correctly.
<pre>
MySQL
SELECT
left(lower(customdefinedfield.name), 63),
customdefinedfield.entitytype,
Count(customdefinedfield.cdf_id)
FROM
customdefinedfield
GROUP BY
left(lower(customdefinedfield.name), 63),
customdefinedfield.entitytype
HAVING
Count(customdefinedfield.cdf_id) > '1'
ORDER BY
1,2
 
PostgreSQL
SELECT
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>
MySQL
SELECT
left(lower(customdefinedfield.name), 31),
customdefinedfield.entitytype,
Count(customdefinedfield.cdf_id)
FROM
customdefinedfield
GROUP BY
left(lower(customdefinedfield.name), 31),
customdefinedfield.entitytype
HAVING
Count(customdefinedfield.cdf_id) > '1'
ORDER BY
1,2
 
PostgreSQL
SELECT
6,632
edits

Navigation menu