Gossamer Forum
Quote Reply
IF TAGS
Which if tags are possible in sql?

Is there a resource to study all of them?

For example:

There is a field with the value "red"
I can use the tag

<%if color eq 'red'%>
rosso
>%endif%>

to translate the value into an other lagnuage.

Now in SQL I have a field with multiple values, selected by
checkboxes.

For example the field color, Values are: red white black

I would need an if tag whith the sense of .....
<%if color contains 'white'%>
bianco
<%endif%>
<%if color contains 'black'%>
nero
<%endif%>
...... and so on

Is there such an if tag !!

Michael





Quote Reply
Re: IF TAGS In reply to
The first set of codes you posted are inaccurately formatted.

You should use:

Code:

<%if color eq 'red'%>
rosso
<%endif%>


The eq operator should work just fine.

Make sure that the field/column color is case sensitive. Perl is case sensitive not like Cold Fusion and other web applications.

Regards,

Eliot Lee
Quote Reply
Re: IF TAGS In reply to
Hi,

The if tags are part of our Template parser, and are not related to SQL. You can only use regular operators like =, eq, >, <, etc. There is no like or comparision operator.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: IF TAGS In reply to
Ok,

what´s the difference between = and eq ?

Michael

Quote Reply
Re: IF TAGS In reply to
= are used for numerical values
eq are used typically for character string values

For more info, go to:

http://www.perl.com

Regards,

Eliot Lee