Solved Error Level in Batchfile

March 8, 2018 at 20:49:35
Specs: WIndows 2008R2, Intel E5-2634

Need help in batch script.I have sqlplus in my batch file.

sqlplus user/password@%ODSHYP% @"%SQL_Query%" >> %BScriptLog%

and my sql query is INSERT INTO IN_EPM SELECT * FROM IN_EPM_ext;.

So when my query throws any error to log we need to check if any error in log file and based on that if error it has to exit the script.

See More: Error Level in Batchfile

Report •

March 10, 2018 at 00:19:47
Wrong forum, should be posted here:

Report •

March 13, 2018 at 00:08:06
Need sample of logfile tail after failed attempt,, and make sure logfile is not Unicode, or otherwise account for that.

message edited by nbrane

Report •

March 14, 2018 at 04:57:12
✔ Best Answer
sqlplus user/password@%ODSHYP% @"%SQL_Query%" >> %BScriptLog%&if %errorlevel% GTR 0 exit/b

try that, but im not sure if it will output the last error >> %BscriptLog% or exit on last error

i5-6600K[delid]@4.814GHz/4.613GHz cache@1.385v | 2x4GB Crucial-DDR4-2133@14-14-14-28 1T 2808MHz@1.35v
Samsung 250GB SSD 850 EVO
MSI Armor RX 570 4GB@1375c/1910m BiosMod

Report •
Related Solutions

Ask Question