cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ERQL query returning attribute list

ccottier
Contributor

Hello,

 

I need to write an ERQL query such as

 

Select [Personne <Système>].[Login] into @Login Where = [Personne <Système>]=["CurrentUser"]

Select [My Metaclasse] Where [My Metaclasse].[user] in @Login

 

Could you help me finding the right syntax for this ?

Thanks

3 Replies

In ERQL syntax you cannot put attribute in the select, unlike in SQL

In ERQL the Where syntax must express a metaAssociationEnd.

 

Your example doesn't work in logic of ERQL and if you keep it in SQL spirit you won't be able to solve your problem. In ERQL you don't compare attribute but "Object" as a whole.

 

 

To answer you question we need to know :

* Which Metaclass exactly you want to query ==> Because the answer will be deferent for each metaclass

*Which relation (MetaAssociation) do you want to use to connect or relate the object you are looking for ?

well I want to find out if it is possible to work with String and object attributes and then filter on String values.

 

Select [Personne <Système>].[Nom] into @Login Where = [Personne <Système>]=&"CurrentUser"

Select [My Metaclasse] Where [My Metaclasse].[userName] in @Login

 

In my example [Nom] and [userName] are Strings

oguimard
Retired

Hello,

 

could you expain the needs using word ?

 

I'm looking  for application where the owner is the current user ? 

 

Select [Responsibility Assignment] Into @PersAss1 Where [Assigned Person]:[Person (System)]= &"CurrentUser" And ( [Business Role] = "~WzF2lb0yGb2U[Application Owner]" Or [Business Role] = "~Ua5nyMC6HLkC[Financial Controller]")
Select [Application] Where [Person Assignment] in @PersAss1

 

There are a lot of example in standard in the tool. More than 400 queries that run using the current user as an option. The one above is the standard example for ITPM solution to get "My Applications".

 

To find those query run this :

Select [Query] Where [_Select] Like "#currentuser#"