Author Topic: Can you use multiple values in <Search Term>  (Read 304 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-79
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Can you use multiple values in <Search Term>
« on: November 16, 2017, 03:28:09 pm »
We have a Project Search that uses the IN operator:
TaggedValue.Value IN ('<Search Term>')

If a single value is supplied, it works fine.  Is there any way to get multiple values in?

I even tried "tricking" the query by making <Search Term>= value1', 'value2
hoping the resulting '<Search Term>' phrase would look like:
'value1', 'value2'
which works; if I hardcode it.  But to no avail!

Is there any way to achieve the multiple values?  Is it actually the expression of a defect?

TIA,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Helmut Ortmann

  • EA User
  • **
  • Posts: 884
  • Karma: +37/-1
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #1 on: November 16, 2017, 10:39:08 pm »
Hi Paolo,

try:
select * from t_object where name in (<Search Term>)

with Search Term:
"rte","bsw"

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7752
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can you use multiple values in <Search Term>
« Reply #2 on: November 16, 2017, 10:58:03 pm »
with Search Term:
"rte","bsw"

Should be 'rte','bsw' with single quotes instead of double quotes to be correct SQL syntax.
Some databases don't care, but others will.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-79
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #3 on: November 17, 2017, 10:47:55 am »
Hi Paolo,

try:
select * from t_object where name in (<Search Term>)

with Search Term:
"rte","bsw"

Kind regards,

Helmut
Hi Helmut,
I'm on the bus so not conncted to our corporate repository, but I found that
select * from t_object where name in (<Search Term>)
didn't even compile.  I didn't even get as far as entering the term to test it.

However, it won't work anyway.  Did you get it to work?  Seems to be a problem with quote bracketing.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 8972
  • Karma: +136/-124
  • I'm no guru at all
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #4 on: November 17, 2017, 08:01:31 pm »
I got it to work on an EAP repo. You need to supply the search term with double quotes.

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 884
  • Karma: +37/-1
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #5 on: November 17, 2017, 10:55:35 pm »
Hi,

I only tested it with *.eap files. That's one of the issues with SQL.

What I see is:
- Make an Add-In Search
- Make a Script

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2436
  • Karma: +29/-2
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #6 on: November 20, 2017, 10:36:52 am »
Yes, it's database-dependent. I couldn't get it to work with a Firebird repository, doesn't like the double quotes.
The Sparx Team
support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-79
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #7 on: November 20, 2017, 10:49:21 am »
I got it to work on an EAP repo. You need to supply the search term with double quotes.

q.
Which version of EAP?  A97 or A2000?  Also, are you using ANSI-92 Searching?  We do for compatibility with our SQL Server DBs.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 8972
  • Karma: +136/-124
  • I'm no guru at all
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #8 on: November 20, 2017, 05:04:40 pm »
Uhm. I don't have any Mickeysoft product on this virtual machine - it's mainly EA. It's running on a XP (yes, still). So it's basically that what Sparx delivers.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-79
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #9 on: November 20, 2017, 05:48:17 pm »
Uhm. I don't have any Mickeysoft product on this virtual machine - it's mainly EA. It's running on a XP (yes, still). So it's basically that what Sparx delivers.

q.
In that case it will be A97 which we can't (and don't want to) use.    :(  I'm pretty certain that the double quotes will work only with A97.

Is that the same with you Helmut?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Helmut Ortmann

  • EA User
  • **
  • Posts: 884
  • Karma: +37/-1
    • View Profile
Re: Can you use multiple values in <Search Term>
« Reply #10 on: November 20, 2017, 09:19:09 pm »
Hi Paolo,

I've only tested it with *.eap files created by EA. I think this is A97.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)