added context variable  in sql queries #2871