[ic] [query] in a [loop]

Xavier GILLET interchange-users@icdevgroup.org
Tue May 6 08:26:00 2003


> > > > Hello,
> > > >
> > > > Did someone tried something like this ?
> > > >
> > > [loop prefix=fichiers arg="a01b02c01 a01b02c02 a01b02c03"]
> > > [set foo][fichiers-code][/set]
> > >  [query
> > >      type=list
> > >      ml=1000
> > >      sql="select actual_status from [scratch foo] where
> > >             posted_by = '[data session username]'
> > >             and
> > >             initial_status = 'confirmee'
> > >          "]
> > >
> > > > It seems not possible to execute a [query] in a [loop].
> > > > Any idea ??
> > >
> > > Try with a scratch...
> > >
> > > Rene
> >
> >
> > It seems the problem come from the [query] inside the [loop].
> > I tried to set a [scratch] value, but it's the same.
>
> Firstly, I think it should be:
>
>   [loop prefix=fichiers list="a01b02c01 a01b02c02 a01b02c03"]
>
> Secondly, [set] does not interpolate. Since you are only using the scratch
> in the page, I suggest you use [tmp]:
>
> [loop prefix=fichiers list="a01b02c01 a01b02c02 a01b02c03"]
>  [tmp foo][fichiers-code][/tmp]
>   [query
>       type=list
>       ml=1000
>       sql="select actual_status from [scratch foo] where
>              posted_by = '[data session username]'
>              and
>              initial_status = 'confirmee'
>           "]
>

Still not working.

[loop prefix=fichiers list="a01b02c01 a01b02c02 a01b02c03"]
 [seti foo][fichiers-code][/seti]
[scratch foo]<br>
  [query
      type=list
      ml=1000
      sql="select actual_status from [scratch foo] where
             posted_by = '[data session username]'
             and
             initial_status = 'confirmee'
          "]
  [list]

  [/list]
[/query]
[/loop]

This loop return just this :
[fichiers-code]

The code is supposed to return :
a01b02c01
a01b02c02
a01b02c03