[ic] Wierdness when using [sql-param] values in subsequent [query] tag

Andrew McBeath interchange-users@icdevgroup.org
Wed Aug 14 00:42:01 2002


Can someone shed light on this problem for me?

I'm wanting to run an SQL statement with values obtained from a previous
query.
Working backwards from the obvious: ...WHERE code='[sql-param sku]'...
which didnt work (when nested), I ended up with the following:

-----------------
[query sql="SELECT * FROM orderline WHERE order_number='[cgi orderId]'" 
type=list interpolate=yes]
   [list]

     [seti aa][sql-param sku][/seti]
     [set bb]00808-Green-XL[/set]

     |[scratch aa]|<br>|[scratch bb]|<br>|[sql-param sku]|<br>

   [/list]
[/query]

[query sql="SELECT * FROM options WHERE code='[scratch aa]'" type=list 
list_prefix="option-list" interpolate=yes]
   [option-list]
     |[sql-param o_enable]|<br>
   [/option-list]
[/query]

[query sql="SELECT * FROM options WHERE code='[scratch bb]'" type=list 
list_prefix="option-list" interpolate=yes]
   [option-list]
     |[sql-param o_enable]|<br>
   [/option-list]
[/query]
-------------------

This displays the following:

---------
|00808-Green-XL|
|00808-Green-XL|
|00808-Green-XL|
|1|
---------

The second query ([scratch aa]) just wont run (or rather wont return any
results)...no errors posted in the logs (including the postgres logs)...

Any ideas?


Cheers

Andrew
-- 
Andrew McBeath
System Admin / Senior Developer
Zeald Ltd
ICQ: 53879543
Ph: +64 9 4157575
Mob: +64 21 434104

-------
By ourselves we are nothing; together we are life itself. - William Horwood
-------