added sql2 query functions