Porting base SQL code to SQL Anywhere