Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - aljazjelen

Pages: 1 [2]
16
General Board / Re: SQL Querry - Get Parent Name
« on: January 13, 2021, 06:57:19 pm »
Hi Geert,

This works like a charm. I will go through your hints and try to implement them in my SQLs in the future. The "join" feature was completely unknown to me until couple of minutes ago.
Thanks for the hints and support!

Happy New Year :)

Regards,
Aljaz

17
General Board / SQL Querry - Get Parent Name
« on: January 13, 2021, 06:32:32 pm »
Hi everyone, hope you are doing well.

For some of you, the topic might be very simple and straightforward.

So I have made a querry which returns a list of all elements of type "Signal" in a selected package. Next step would be to obtain a name of a parent of an object "o" (similar to .getElementbyId() and then searching for a name in jscript).

Code: [Select]
select pkg.Name as "Package Name" , o.Name as "Name", o.Status as "Status", o.ParentID as "Parent ID", o.Object_ID as "Object ID", pkg.Package_ID as "Pkg Package_ID"
FROM t_object o, t_package pkg
where pkg.Package_ID IN (#Branch#) AND o.package_ID = pkg.Package_ID and o.Object_Type = "Signal"

However I am stuck at how to select a name of a parent, knowing the parent id?. Could anyone point me in the direction? Is this even possible with simply SQL querries in Scratchpad?

Thanks for your support!

Best regards

18
Hi Geert,

Sorry for taking time to answer.

With your support, I managed to find a work around by using the #CurrentElementGUID.

Topic can be closed.

Regards,
Aljaz

19
Hi Geert!

Thank you so much for pointing it out. I played a bit around and your solution got me in the right direction :)

I have however last issue in my recent roller-coaster. Lets say, for an example, I only want to querry the connections within selected package.
I digged around a bit and came to idea to add another condition, modifying existing statement from:
Code: [Select]
where t_xref.Client = t_connector.ea_guid and t_xref.description LIKE '#WC#'+t_object.ea_guid+'#WC#' and so.object_id = Start_Object_ID and eo.object_id = End_Object_ID
to:
Code: [Select]
where t_xref.Client = t_connector.ea_guid and t_xref.description LIKE '#WC#'+t_object.ea_guid+'#WC#' and so.object_id = Start_Object_ID and eo.object_id = End_Object_ID and so.name LIKE 'MY_SELECTED_OBJECT_NAME'
(notice the "and so.name LIKE 'MY_SELECTED_OBJECT_NAME'")

This yields results I wanted, however I would want to "select my object" by clicking on the diagram and then use the querry to get all the relevant searches. I want to avoid to manually type the name of object.
There is for sure some kind of a "pointer" or "selector", from where i could get the name of selected object. Something like "selected.name"?

Best regards,
Aljaz

20
Hi Geert, thanks for the feedback.

I have already gone through the forum and found a topic which could help me most. However I would need a hand with a following SQL:
Code: [Select]
select Connector_ID, Direction, Connector_Type, t_object.Name as "Obj-Name", so.name as "Start-Name", eo.name as "End-Name"
from t_connector, t_xref, t_object, t_object so, t_object eo
where t_xref.Client = t_connector.ea_guid and t_xref.description LIKE '#WC#'+t_object.ea_guid+'#WC#' and so.object_id = Start_Object_ID and eo.object_id = End_Object_ID and t_object.name LIKE '<Search Term>'

I added this in the SQL Scratch Pad (in the "search window"), however it yields no results.

What could be an issue?

Regards,
Aljaz

21
Hi everyone,

First I would like to say thank you for accepting me in the community ;)
So, I am not an expert on EA/databases, however I can script with python quite well.

Recently I made a model, where classes are connected via information flow signals. Each signal has one or many names (Information Items Conveyed...).
Now, since the model is getting more and more complex, I would like to track the signal connection/usage between diagrams.
I figured out, one way could be that I export XMI and run a python script to look for signal names and obtain "target" and "sources" and save everything externally (in a CSV for example).
However... I am pretty sure there is better way, something with SQL querries?

Is there such a simple way?

Thanks!

Pages: 1 [2]