Sparx Systems Forum
Enterprise Architect => Bugs and Issues => Topic started by: TonyC on February 03, 2022, 04:28:31 am
-
I can successfully export a package which includes all the element types on the diagrams by using the Export csv function and creating a specification. When I leave the Types field blank, all element types down to Classes are exported.
However, what I need is an export that goes one step deeper. I would like to list all the attributes in every class in a csv so I can import into Excel the list of attributes by class name. Is there a way to do this? Any help would be gratefully received
-
You can create an SQL search an then export the results to CSV:
select a.ea_guid AS CLASSGUID, 'Attribute' AS CLASSTYPE, o.Name as ClassName, a.Name as AttributeName, a.Type, a.Stereotype, a.Notes
, package.name as PackageName ,package_p1.name as Package_level1,package_p2.name as Package_level2 ,package_p3.name as Package_level3
from (((((t_attribute a
inner join t_object o on o.Object_ID = a.Object_ID)
inner join t_package package on package.Package_ID = o.Package_ID)
left join t_package package_p1 on package_p1.package_id = package.parent_id)
left join t_package package_p2 on package_p2.package_id = package_p1.parent_id)
left join t_package package_p3 on package_p3.package_id = package_p2.parent_id)
where o.Package_ID in (#Branch#)
and o.Object_type in ('Class', 'Datatype')
Geert
-
The problem with SQL results is that the search window will not copy RFC-aware. That is, quoting is rubbish and if you got semicolons in the result you can forget it.
q.
-
The problem with SQL results is that the search window will not copy RFC-aware. That is, quoting is rubbish and if you got semicolons in the result you can forget it.
q.
They have improved that a lot in recent versions. (if you use the option export to CSV, not sure if that is exactly the same as copy/paste)
Geert
-
I might look into that once more. That behavior buggered me for so long that I just did not use it any longer...
q.
-
I just use CTRL-A to select everything directly in the search results window, then paste special into Excel with comma as separator and double quote as text marker. Seems to work OK even for 3-400K rows * 15 columns of results
-
It looks like they replaced the separator with a comma. And (oh wonder) they quote text when it contains a comma. And (more wonders) they even dbl-quote a quote when it occurs. Miracles happen eventually.
q.
-
It looks like they replaced the separator with a comma. And (oh wonder) they quote text when it contains a comma. And (more wonders) they even dbl-quote a quote when it occurs. Miracles happen eventually.
q.
Told you it had been improved ;D
Geert
-
I only trust what I see with my own eyes xD
q.
-
You can create an SQL search an then export the results to CSV:
Geert
Many thanks Geert, this is precisely what I required and your SQL worked a treat.
Regards,
Tony