Unfortunately this is not supported in Run Database Query form action.
If the db query fails then it will trigger the error and stop the form submission, and if its successful, the form submission will proceed. Thats all what is exposed by this form action.