Parametric Search Query

Post Reply
michel.weber
Posts: 256
Joined: Sat Oct 08, 2005 12:40 pm

Parametric Search Query

Post by michel.weber »

What exactly is allowed in the SQL Query clause? Can you point me to some documentation?

Functions do not seem to be allowed, for example the following gives an error :

StartDate <= DATE('now') AND EndDate > DATE('now')

also IN does not seem to work properly (without an error message) :
LanguageCoE IN ($qpLanguage)

When i pass EN in the search form, that works, but EN,FR does not.
User avatar
mark
Site Admin
Posts: 5498
Joined: Tue Apr 25, 2000 6:56 pm

Parametric Search Query

Post by mark »

The SQL docs are at http://www.thunderstone.com/site/texisman/

StartDate <= convert('now','date')
If StartDate is a date type the conversion is automatic
StartDate <= 'now'

Strings need to be quoted for IN syntax
LanguageCoE in ('EN','FR')
User avatar
John
Site Admin
Posts: 2587
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Parametric Search Query

Post by John »

Or if you want to pass a parameter into IN() then make it a strlst first, e.g.

<sum "%s," $langs>
<$qpLanguage=(convert($ret, 'strlst' ))>
<sql "... Field in ($qpLanguage) ...">
John Turnbull
Thunderstone Software
michel.weber
Posts: 256
Joined: Sat Oct 08, 2005 12:40 pm

Parametric Search Query

Post by michel.weber »

Sorry, my question was not clear.

I was talking about the appliance/webinator admin interface on the search settings page
User avatar
Kai
Site Admin
Posts: 1263
Joined: Tue Apr 25, 2000 1:27 pm

Parametric Search Query

Post by Kai »

The alphanumeric tokens allowed in a Parametric Search query are currently "and" "or" "not" "like" "matches" "in" "between", or a Parametric field name defined for that profile. Integer constants and single-quoted strings are allowed too.

You could rewrite your SQL as:

StartDate <= 'now' AND EndDate > 'now'

assuming StartDate is a Date type field.

For the IN query, set separate values for $qpLanguage, e.g. `qpLanguage=EN&qpLanguage=FR' in the query string.
Post Reply