Forum OpenACS Q&A: I got a 0or1row failed (exception NSINT, Query returned more than one row)

Hi, I was trying to make a query like this:

select count(p.first_names)
        from persons p, parties pa, usuarios_micolegio_categoria umc where lowe(p.first_names)  = lower(:first_names) and lower(p.last_name) = low(:last_name) and umc.categoria = :categoria and umc.user_id = p.person_id and pa.party_id = p.person_id and like :likeDomin

I'am trying to get the number of users of one domain, whith the same category and that the first_names and the last_name is iqual to a parameter I recive.

Thanks in advance for your replay, Rod

That's strange. Perhaps the problem is the like statement? I don't know.
Run the query from psql and see what it is returning.
I don't get it!!!!
I run it in psql and it returns a single number. Just like I would like it to work in the .tcl.
Also I tried changing the :likeDomin part of the query, who contains '%somedomain.something, whith a valid domain and the same 0or1row fail.
What should I do???
Thnx for all your help.
It obviously isn't running that query because coun(*) always returns one row.

Do you have SQL logging enabled in AOLserver?  If so, could you post not only the error message but the actual query it thinks it is running?

Is the query inline or in a query file?  A new query, or did you overwrite an existing query?  Remember that queries in a query file override inline queries.

Thank you very much!!!!
I've solve the problem, stupid I was. I was focus only in one query and the one that was making troueble was a simple one defined at the end. Thanks for your time. Hope I could solve the other one. I'll post it (ONES)