14
« on: January 22, 2020, 09:13:03 pm »
Hello, So it takes me some time to write the query to retrieve all my info.
I share with you if it can help someone :
SELECT op.OperationID, op.Name AS opName,
optag1.value AS satisfies,
optag2.value AS rationale,
optag3.value AS subordinates,
optag4.value AS dependencies,
optag5.value AS resources,
optag6.value AS datas,
optag7.value AS errorCode,
GROUP_CONCAT( DISTINCT CONCAT_WS(' *** ',CONCAT_WS(' | ',CONCAT_WS(' : ',opParams.Name,opParams.Type),opParams.Kind),opParams.Notes) ORDER BY opParams.Name SEPARATOR '\n') AS AllParams,
op.Type AS opRetType,
op.Behaviour AS opBehaviour,
op.Notes AS opNotes,
tCallsBy.CallsBy AS CallsBy
FROM t_object AS obj
LEFT JOIN t_operation AS op ON obj.Object_ID = op.Object_ID
LEFT JOIN
(SELECT t2.OperationID, t2.name, group_concat(t1.name) AS CallsBy
FROM t_operation t1
LEFT JOIN
(SELECT to2.OperationID, to3.ElementID, to2.name
FROM t_object to1
LEFT JOIN t_operation to2
ON to1.Object_ID = to2.Object_ID
LEFT JOIN t_operationtag to3
ON to3.VALUE LIKE CONCAT("%", to2.Name, "%")
WHERE to3.Property = 'Calls'
AND to1.Object_ID = '#OBJECTID#') t2
ON t1.OperationID = t2.ElementID
WHERE t2.ElementID is not null
GROUP BY t2.name) tCallsBy ON op.OperationID = tCallsBy.OperationID
LEFT JOIN t_operationparams ASopParams ON op.OperationID = opParams.OperationID
LEFT JOIN t_operationtag AS optag1 ON (op.OperationID = optag1.ElementID AND optag1.Property = 'Satisfies')
LEFT JOIN t_operationtag AS optag2 ON (op.OperationID = optag2.ElementID AND optag2.Property = 'Rationale')
LEFT JOIN t_operationtag AS optag3 ON (op.OperationID = optag3.ElementID AND optag3.Property = 'Calls')
LEFT JOIN t_operationtag AS optag4 ON (op.OperationID = optag4.ElementID AND optag4.Property = 'Constraints')
LEFT JOIN t_operationtag AS optag5 ON (op.OperationID = optag5.ElementID AND optag5.Property = 'Use_Extern')
LEFT JOIN t_operationtag AS optag6 ON (op.OperationID = optag6.ElementID AND optag6.Property = 'Use_Local')
LEFT JOIN t_operationtag AS optag7 ON (op.OperationID = optag7.ElementID AND optag7.Property = 'Error_Code')
WHERE obj.Object_ID = '#OBJECTID#'
GROUP BY op.Name
But I have a problem the text return by op.Behaviour AS opBehaviour and op.Notes AS opNotes have the formating inside (i>, /i>, b>, ...), do you know If it is possible to format correctly the text when it is print in the generated doc ?