in reply to win32::odbc & SQL from command line

Have you tried 'dbish' - "interactive command shell for Perl DBI"?

update: As for the not a code reference bit. it is because of the $db->("$query5b") where which you probably mean $db->prepare("$query5b"); or $db->do("$query5b"); instead.

-enlil