Book a Demo

Author Topic: Advanced SQL queries with '#WC#<Search Term>#WC#'  (Read 3708 times)

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Advanced SQL queries with '#WC#<Search Term>#WC#'
« on: December 07, 2022, 05:18:03 am »
all,
my understanding is that  '#WC#<Search Term>#WC#' returns a String of the search term. However this is not working as expected
given a search value of '9.9.8'
Code: [Select]
....
AND ApplicationIdentifier.value LIKE '#WC#<Search Term>#WC#'

returns as expected:
  • '9.9.8'
  • '9.9.8'.1
  • '2.9.9.8'

that is correct but not precise if the user wants the exact match. However

Code: [Select]
....
AND ApplicationIdentifier.value = '#WC#<Search Term>#WC#'

returns nothing !?
what Am i missing here?
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Advanced SQL queries with '#WC#<Search Term>#WC#'
« Reply #1 on: December 07, 2022, 07:27:33 am »
<Search Term> will be replaced by the value you enter in the search box.
#WC# will be replaced by the appropriate wildcard (% or * depending on the database driver)

So if you want to search for an exact match, use <Search Term> without the wildcards.

Geert

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Re: Advanced SQL queries with '#WC#<Search Term>#WC#'
« Reply #2 on: December 07, 2022, 08:19:52 am »
it works!
great as always Geert!!!
thank you
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Advanced SQL queries with '#WC#<Search Term>#WC#'
« Reply #3 on: December 07, 2022, 09:22:24 am »
Eh, Giuseppe,
LOVE the tagline!

"The above content reflects my own opinion and is not endorsed by Monthy Python"

(my emphasis)

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

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Re: Advanced SQL queries with '#WC#<Search Term>#WC#'
« Reply #4 on: December 07, 2022, 09:30:29 am »
grazie Paolo!
😅
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python