Book a Demo

Author Topic: Separator for multi-statement sql query in search  (Read 3474 times)

amacara1

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Separator for multi-statement sql query in search
« on: January 13, 2023, 11:20:39 pm »
I am trying to write a multi-statement sql search query and it looks to me this is not supported.

This works fine, in the sense that it prints content of t_object:
select * from t_object

But, this does seem to not execute at all, without even returning error messages:
declare v as int; select * from t_object
(I can even write typos and nothing is reported)

Using ENTER or Ctrl+ENTER or even removing ; do not seem to help. What am I missing, please?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Separator for multi-statement sql query in search
« Reply #1 on: January 14, 2023, 01:21:07 am »
In EA search you can only use a query that starts with "select". If it doesn't start with "select" EA doesn't even try processing it.
It won't execute any non-query commands.

Geert

amacara1

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: Separator for multi-statement sql query in search
« Reply #2 on: January 14, 2023, 02:31:54 am »
Thank you!
Is then there a way to create a variable somehow? My query needs name/guid of a package in several places (I am using that 'pragmatic' search for all-elements-in-a-subtree) and I would like to write the name just once.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Separator for multi-statement sql query in search
« Reply #3 on: January 14, 2023, 02:45:36 am »
Thank you!
Is then there a way to create a variable somehow? My query needs name/guid of a package in several places (I am using that 'pragmatic' search for all-elements-in-a-subtree) and I would like to write the name just once.
No, but you can use the #Branch# macro if you want to select all in a subtree.
There's also a macro for the selected package, but you'll have to look that one up in the manual.

Geert

amacara1

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: Separator for multi-statement sql query in search
« Reply #4 on: January 14, 2023, 03:24:42 am »
I understand, but I use the sql query for a matrix specification