I really like to automate it, in any case of error.

How can avoid that sqlplus stops waiting for the user interaction when there is a connection error?

Thanks again