Forum OpenACS Q&A: strange db_1row behaviour

Collapse
Posted by Ben Chan on
I'm trying to call db_1row and it's failing, saying "Query did not return any row.", but it should return 1 row. I'm calling it like this:
db_1row select_policy SQL -column_array policy
and inside the XQL file I use this query:
select p.*
from rsvp_policies p join rsvp_reservations r on (p.policy_id = r.policy_id)
where r.reservation_id = :reservation_id
When I go into psql and do the query, it returns exactly one row. I've tried hardcoding the query in without using the XQL file and checked that reservation_id is indeed present. Any ideas on what's wrong? Thanks
Collapse
Posted by Dave Bauer on
I suspect the message that says "Query did not return any row" means in fact that the query returned an error message instead. Make sure debug is turned on in your config file and check the error log more closely to see if there is a more descriptive error.

Check to make sure the query file is loaded and the query is named correctly.