Forum OpenACS Development: Re: I got this, 0or1row failed (exception NSINT, Query returned more than one row

db_string doesn't require you give a name to the single column you return.  db_string foo "select count(*) ..." is just fine.

The reason for putting the query in an .xql file is to make it easier to support both Oracle and PostgreSQL.  Standard SQL queries supported by both RDBMS's go into a vanilla .xql file, custom Oracle or PostgreSQL queries into the appropriate custom .xql file with the appropriate XML tag to designate which RDBMS uses the query.

Now ... you posted in the main forum, too - please don't double post!  It just confuses things.  Check out my response in the other forum - please post your log file contents with SQL logging enabled.  Then we can see what is actually being executed.

Oh - if you accidently gave the query the same name as another query in the script I think the query processor will always return the first one rather than give an error ... hmmm ... this is a pretty good guess on my part I think!