Updating authorization code queries to ensure compatability with various database engines.