open and execute sql in single call