It's amazing how writing something down can help you think better, plus a bit of searching on general SQL fora. I didn't really need to join all the tables, as I was just extracting data from them, so I reduced by LEFT JOINs to 'Where' statements. You can use memo fields in 'Where' statements. The downside of this is that it won't work if there is more than one information item conveyed (when EA puts both guids in the same Description field, separated by commas).
SELECT t_connector.ea_guid AS CLASSGUID, t_connector.Connector_Type AS CLASSTYPE, t_connector.Connector_ID AS [IER ID], t_connector.Name, TO1.Name AS Source, TO2.Name AS Destination, TO3.Name AS [Info Item Conveyed], t1.VALUE AS [Data Size], t2.VALUE AS Unit, t3.VALUE AS Frequency, t4.VALUE AS [Protective Marking], t5.VALUE AS Timeliness, t6.VALUE AS [Applicable Standards], t7.VALUE AS Provenance, t8.VALUE AS Validation
FROM t_connector, t_object AS TO2, t_object AS TO1, t_connectortag AS t1, t_connectortag AS t2, t_connectortag AS t3, t_connectortag AS t4, t_connectortag AS t5, t_connectortag AS t6, t_connectortag AS t7, t_connectortag AS t8, t_xref AS XCON, t_object AS TO3
WHERE t_connector.Stereotype='IER'
AND t1.Property='Data Size'
AND t2.Property='Unit'
AND t3.Property='Frequency'
AND t4.Property='Protective Marking'
AND t5.Property='Timeliness'
AND t6.Property='Applicable Standards'
AND t7.Property='Provenance'
AND t8.Property='Validation'
AND t_connector.End_Object_ID=TO2.Object_ID
AND t_connector.Start_Object_ID=TO1.Object_ID
AND t_connector.Connector_ID=t1.ElementID
AND t_connector.Connector_ID=t2.ElementID
AND t_connector.Connector_ID=t3.ElementID
AND t_connector.Connector_ID=t4.ElementID
AND t_connector.Connector_ID=t5.ElementID
AND t_connector.Connector_ID=t6.ElementID
AND t_connector.Connector_ID=t7.ElementID
AND t_connector.Connector_ID=t8.ElementID
AND XCON.Behavior='conveyed'
AND XCON.Description=TO3.ea_guid
AND t_connector.ea_guid=XCON.Client
Does anyone know a cute way of searching within a memo field for a string? The 'LIKE' operator doesn't seem to work in this way, even when using wildcards infront and/or behind it. The section in question is:
AND XCON.Description LIKE TO3.ea_guid
I've tried '%'+FIELDNAME+'%', but it doesn't seem to work (except for those with only one item conveyed, just like the original statement.
Rgds
Chris