This is my code. I want to get only 0 if the database connection is successfully else 1. But sqlplus.exe always returns 0.
I call the file sqlplus with the parameter user,password and databasename. After this i try to get the exit code which should be 0 if the connection was successfully but it always returns 0
call exit | C:\app\client\sahi\product\12.1.0\client_1\BIN\sqlplus.exe
%DBUser%/%DBPassword%@%DBName%
if errorlevel 0 (
echo successfull
goto success
)
How can i do this?