Author Topic: SQL search macros not working?  (Read 4321 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
SQL search macros not working?
« on: June 19, 2012, 12:00:25 am »
Hey guys,


This seems weird, but...
I can't get the SQL search macros #WC# or #Author# to work.

I've tested on 9.2.921 against a SQL Server repository, and with 9.3.934 on an .EAP file.
In both cases, the construction
Code: [Select]
WHERE Name like '#WC#lass#WC#' fails to return anything, but using the correct wildcard characters (% and *, respectively) returns all "Class1" elements.

Similarly, the construction
Code: [Select]
WHERE Author like '#Author#' returns nothing, but if I substitute the text from the relevant option it works.

I tried using the #Author# macro in a non-SQL search filter - and that works.

Clearly I must be doing something wrong, but I can't see what.
Anyone else spot it?

Thanks,


/Uffe
« Last Edit: June 19, 2012, 12:01:23 am by Uffe »
My theories are always correct, just apply them to the right reality.

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: SQL search macros not working?
« Reply #1 on: June 19, 2012, 02:44:13 am »
Hi Uffe,

I notice that when you define a new search query of type 'SQL editor', the search builder tab -becomes editable-. Paste your SQL search macro in this tab instead of the SQL tab and run => you will get results.  :-?

Perhaps someone forgot to remove the (now redundant) SQL tab and rename the search builder tab (or i'm missing something)?

Paulus

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: SQL search macros not working?
« Reply #2 on: June 19, 2012, 04:51:52 am »
The Search Builder interprets the macros while the SQL tab does not. So Paulus is right.

However, the SQL tab is only for temp SQL. It does not store the SQL related to the newly build search. This is to be found in the Search Builder.

q.
« Last Edit: June 19, 2012, 04:53:35 am by qwerty »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: SQL search macros not working?
« Reply #3 on: June 19, 2012, 03:08:49 pm »
Whoa - that's seriously scary!  :o

The SQL tab kinda-works-but-not-quite when you've got the simple (filter-type) search definition up. When you have created a SQL search and are editing that in the Search Builder tab, that works as specified in the manual.

Put another way, the macros don't apply to the SQL tab, only to SQL entered into the Search Builder tab.

Not entirely konc... cons... that.
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: SQL search macros not working?
« Reply #4 on: June 19, 2012, 06:16:41 pm »
Yep. The whole structure of the builder is somewhat scary. Let alone the Builder button which is present as Options/Manage Searches a second time. Well, as you said: EAUI konzistend

q.