If I have a Windows batch (BAT or CMD) file, and I am executing some sql:

How do I hadle errors of connecting to SQLPlus, lets say that I try to connect to SQLPlus and but get some error, is there some kind of exit code (like in UNIX Shell) ? Depending on the result I need to retry after 10 mins or exit, etc.

Thanks in advance.