Added exception to pass sql and param context