I have a script db.bat as below:
@echo off
setlocal enabledelayedexpansion
for /F "tokens=*" %%A in (user.txt) do (
sqlplus -s %%A @fetch.sql >> output.txt
)
where user.txt (list of all user details for which I need expiry date. this list may have around 40-50 rows) is:
dbuser/password@database1
readuser/p@ssw0rd@database1
adminuser/Pa$$word@database2
.......
.......
.......
and fetch.sql is:
set pagesize 20
set linesize 200
select username, expiry_date from user_users;
exit;
The problem I am facing here is, whenevey my script db.bat encounters any SQL ERRORS like given below, its not moving further and getting hanged at that point until I manually stop that.
SQL ERRORs:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
ERROR:
ORA-28000: the account is locked
I have checked that there is a WHENEVER SQLERROR command that works in this situation but don't know how I can use it here.