{"id":2734,"date":"2018-06-07T08:26:50","date_gmt":"2018-06-07T06:26:50","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=2734"},"modified":"2018-06-07T08:26:50","modified_gmt":"2018-06-07T06:26:50","slug":"sparx-systems-enterprise-architect-sql-get-all-images-with-imageid-of-a-diagram","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=2734","title":{"rendered":"Sparx Systems Enterprise Architect SQL: Get all Images with ImageID of a diagram"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>All Images of an Diagram (the ImageIds) shall be determined, so that can be read out from the table t_image (see previous article about BLOB and EA).<\/p>\n<h1>Approach &#8211; Ansatz<\/h1>\n<p>Usage of the tables<br \/>\n&#8211; t_diagram<br \/>\n&#8211; t_diagramobjects<br \/>\n&#8211; t_object <\/p>\n<h1>Solution &#8211; L\u00f6sung<\/h1>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSELECT\tdia.Name As Diagram,\r\n\t\tIIF(Trim(objstart.&#x5B;Name]) = 'Text', 'Text', objstart.stereotype) As stereotype, \r\n\t\tdiaobj.RectLeft As x,\r\n\t\tdiaobj.RectTop As y,\r\n\t\tdiaobj.RectRight-diaobj.RectLeft As Width,\r\n\t\tAbs(diaobj.RectBottom-diaobj.RectTop) As Height,\r\n\t\tobjstart.Object_ID,\r\n\t\tIIF(Trim(objstart.&#x5B;Name]) = 'Text', 'Text-'&amp; objstart.Object_ID ,objstart.Alias) As &#x5B;key],\r\n\t\tIIF(objstart.&#x5B;Name] = 'Text', objstart.Note, objstart.&#x5B;Name]) As phaseName,\r\n\t\tobjstart.&#x5B;ea_guid] As &#x5B;guid],\r\n\t\tdiaobj.ObjectStyle,\r\n\t\tIIF(\r\n                    InStr(diaobj.ObjectStyle, &quot;ImageID&quot;)&gt;0, \r\n                    Mid(diaobj.ObjectStyle, InStr(diaobj.ObjectStyle, &quot;ImageID&quot;)+8 , Len(diaobj.ObjectStyle)- (InStr( diaobj.ObjectStyle, &quot;ImageID&quot;)+8) ),\r\n                    ''\r\n        ) As ImageId     \r\nFROM\r\n((\r\n\t\t&#x5B;t_diagram] dia LEFT JOIN (Select Diagram_ID, Object_ID, RectLeft, RectTop, RectRight, RectBottom, ObjectStyle from &#x5B;t_diagramobjects]) diaobj ON dia.&#x5B;Diagram_ID]=diaobj.&#x5B;Diagram_ID])\r\nLEFT JOIN &#x5B;t_object] objstart ON objstart.&#x5B;Object_ID]=diaobj.&#x5B;Object_ID])\r\nWHERE objstart.Object_Type IN ('Text','Boundary') AND IIF(InStr(diaobj.ObjectStyle, &quot;ImageID&quot;)&gt;0, \r\n                                                                Mid(diaobj.ObjectStyle, InStr(diaobj.ObjectStyle, &quot;ImageID&quot;)+8 , \r\n                                                                Len(diaobj.ObjectStyle)- (InStr( diaobj.ObjectStyle, &quot;ImageID&quot;)+8) ),\r\n                                                                '') &lt;&gt; ''\r\nAND dia.Name='{PutInYourDiagramNameHere}' \r\nORDER BY 12 DESC,1,2,3,4,5,6,7,8,9    \r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D2734&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px;margin-top:5px;\"><\/iframe>","protected":false},"excerpt":{"rendered":"<p>Problem All Images of an Diagram (the ImageIds) shall be determined, so that can be read out from the table t_image (see previous article about BLOB and EA). Approach &#8211; Ansatz Usage of the tables &#8211; t_diagram &#8211; t_diagramobjects &#8211; t_object Solution &#8211; L\u00f6sung SELECT dia.Name As Diagram, IIF(Trim(objstart.&#x5B;Name]) = &#8218;Text&#8216;, &#8218;Text&#8216;, objstart.stereotype) As stereotype, &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=2734\" class=\"more-link\"><span class=\"screen-reader-text\">Sparx Systems Enterprise Architect SQL: Get all Images with ImageID of a diagram<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[28,43],"tags":[],"class_list":["post-2734","post","type-post","status-publish","format-standard","hentry","category-sparx-systems-enterprise-architect","category-sql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-I6","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2734"}],"version-history":[{"count":1,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2734\/revisions"}],"predecessor-version":[{"id":2735,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2734\/revisions\/2735"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}