[ic] if data
Kevin Walsh
interchange-users@icdevgroup.org
Wed Oct 30 08:41:01 2002
Rene Hertell [rene@hertell.com] wrote:
>
> I'm trying to check if a value exists in a field, and show a proper output
> based on that.
> My problem seems to be that my syntax is not correct.
>
> I pull a value from an other table with the following line.
> [data table=seurat col=www foreign=seura key='[sql-param seura]']
>
> When doing a [if data table=seurat col=www foreign=seura key='[sql-param
> seura]'][then]...[else], I get only the [else]-part executed..
>
In 4.9 and later version of 4.8, you should be able to do this:
[if type="data" term="seurat::www::[sql-param seura]::seura"]
...
[/if]
In all versions that support foreign key lookups, you'll be able to
do this:
[if type="explicit"
compare="[data table=seurat col=www foreign=seura key='[sql-param seura]']"]
...
[/if]
>
> I tried also to create a scratch, and evaluate that, but with the same
> result.
>
I'm assuming you did this:
[tmp tmp][data table=seurat col=www foreign=seura key='[sql-param seura]'][/tmp]
[if scratch tmp]
...
[/if]
That method should work. If not then perhaps you should be looking
elsewhere for the problem, such as the [data] tag or the database data
itself.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/