Book a Demo

Author Topic: Query operation / attribute types  (Read 4224 times)

royvanmarrewijk

  • EA User
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Query operation / attribute types
« on: August 29, 2016, 10:20:09 pm »
Hi,

I have blocks with operations that use an enum as returntype and now I would like to write a query which gets values of the returned enum. For so far I have this:

Code: [Select]
SELECT opPar.*
FROM t_operation op, t_operationparams opPar
WHERE op.OperationID = 5929
AND opPar.OperationID = op.OperationID

Now the problem is that t_operationparams.Type contains the name of the enum and that I have multiple Enums with the same name (//not nice but for now out of scope). So how can I access the specific enum (by its Object_ID of guid)?

kind regards,
Roy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Query operation / attribute types
« Reply #1 on: August 29, 2016, 10:22:22 pm »
Roy,

You should use the classifier:

Code: [Select]
select * from t_operationparams op
inner join t_object o on o.Object_ID = op.Classifier

Geert

royvanmarrewijk

  • EA User
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Query operation / attribute types
« Reply #2 on: August 29, 2016, 10:37:13 pm »
Geert,

Thanks again!

The classifier of the operation is 0 in my case. I think this has something to do with a copy / paste action. If there is a workaround I would like to know  8) I the meantime I'll focus by fixing the problem at the source.

Roy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Query operation / attribute types
« Reply #3 on: August 30, 2016, 12:45:54 pm »
If the classifier is 0 that means that the attribute or parameter isn't linked to an element and only has the name string to identify the type.

Geert