Originally posted by Peter Primrose:
is there such thing as sql debugger? for viewing the return result?
I wouldn't really call them debuggers, but there are quite a number of general purpose SQL client applications that allow you to send an arbitrary SQL statement and view the result, as well as explore a database. Many of them are free and open source.
A partial list is here, it includes all the ones my coworkers favor:
http://java-source.net/open-source/sql-clients There are also some commercial ones.