Book a Demo

Author Topic: SQL Query : Ensuring <Search Term> has been populated ?  (Read 4007 times)

Bumble

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
SQL Query : Ensuring <Search Term> has been populated ?
« on: September 21, 2018, 09:27:16 pm »
Hi,
I'm new to Sparx and am after a bit of help please  :)

Is there a way when you are utilizing the <Search Term> in an SQL query, you can ensure  that it has been populated when the query runs ?
eg

 where t_diagram.Author LIKE '#WC#<Search Term>#WC#'

Thankyou !

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: SQL Query : Ensuring <Search Term> has been populated ?
« Reply #1 on: September 21, 2018, 10:35:22 pm »
Adding
Code: [Select]
and len('<Search Term>') > 0seems to be working for SQL Server.  Should be the same in Access syntax (.eap and .eapx)

Geert

Bumble

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: SQL Query : Ensuring <Search Term> has been populated ?
« Reply #2 on: September 21, 2018, 11:14:43 pm »
 I will give that a try.

Thanks for your help Geert  :)