[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] if data
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
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/
- Follow-Ups:
- [ic] Secure?
- From: interchange-users@icdevgroup.org (Chris Bartholomew)
- [ic] Secure?
- From: interchange-users@icdevgroup.org (Chris Bartholomew)
- References:
- [ic] if data
- From: interchange-users@icdevgroup.org (Rene Hertell)