Seconding chacham's remark, I think prepending the table names with "$connect{database}." in the SELECT and UPDATE statements is superfluous, because you are connected with only that database. Plus removing these parts would increase readability of the SQL strings.
Comment on Re: Sending Custom Mass Mail - Fastest Way Possible
because you are connected with only that database.
Good point. I completely missed that. FWIW, you can connect to another database in SQL Server by using a qualified object name, which includes the database name.
Conversely, this cannot be done in Oracle, as it would require a database link, which instead follows the object name.