Refactoring SQL executor

Hi Marc,
I have corrected the errors and polished the code based on your feedback.
Thank You