i've come back to this after a while. i've looked at the perl module you mentioned above (or rather Text::Query::BuildSQL), but i'm not really sure how to use it. pardon my ignorance, but can anyone point me to some examples? i really appreciate the help.