Thnx Alfred, I'm sorry for the delay because I'am new at this. So, I tried what you suggest but I did not get what I spect. I did this select count(first_names) as first_name_count, but first_name_count was not available because it throws this: can't read "person_count": no such variable
while executing
"if {$person_count > 0} {
.....
So then I tried the query like this:
set personCount [db_string personExist "select count(p.person_id) as person_count
from (select pe.person_id as person_id, pe.first_names as first_names, pe.last_name as last_name from persons pe, parties pa where pe.person_id = pa.party_id and pa.email like :likeDomin ) p, usuarios_micolegio_categoria umc where lower(p.first_names) = lower(:first_names) and lower(p.last_name) = lower(:last_name) and umc.categoria = :categoria and umc.user_id = p.person_id"]
But it steel throws 0or1row fail Query was not a statement returning rows. I'am not exactly sure if its valid to do that kind of like :likeDomin, where the variable likeDomin contain '%somedomain.something'.
What should I do??