Forum OpenACS Development: Re: xql files don't work

Collapse
5: Re: xql files don't work (response to 1)
Posted by Richard Hamilton on
They definitely do!

Here are some things to check:

1) .xql file and .tcl file exactly similar names.

db_foreach select_states { } {
lappend item_status_options [list $state $state $num_items]
}

2) A complete set of xml tags in xql file:

<?xml version="1.0"?>

<queryset>

<fullquery name="select_states">
      <querytext>
        select c.category as state, count(c.category_id) as num_items
        from im_categories c,im_conf_items i
        where c.category_id = i.conf_item_status_id
        group by c.category
      </querytext>
</fullquery>

</queryset>

3) Check that the unix permissions are correctly set on the files.

4) Retart the server:

kill -9 `cat /usr/local/aolserver/log/nspid.yourserver`

or use developer support to re-load the changed file. This is beause the xql files are ONLY sourced at server startup time.

5) If it still won't play, copy another query/tcl pair and modify it to avoid errors creeping in. For what it is worth, most code has the query in quotes in the tcl as well as in the xql:

db_foreach "query_name" {code per row}

and I always put it in both places. You can still verify which query is running by making a change to one of them that is obvious from the results.

6) Weep with frustration at the knowledge that if it still doesn't work, its your fault! :-|

Been there.

Regards
Richard