Tom's Guide | Tom's Hardware | Tom's Games | PC Safety Suite
![]() |
![]() |
![]() |
Comment:
I have created a batch file that connects to a server and executes query in an sql file..In sql im deleting some records from the table..even after i delete the records,the batch windows is still open and also I have an monitor to see the status of the event..its still executing and not completed..how can i close the process of the batch file??
the batch file is "
@Echo Off
Set _InputFile=\\as-sisccsfsv02\Paybase2dev\DelDups\config.txt
Set _Data1=""For /F "tokens=1,2* delims=:" %%A IN (%_InputFile%) DO Set _Data%%A=%%C
IF "%_Data1%"=="" set _Data1=1set _
sqlplus %_Data3%/%_Data4%@%_Data5% @%_Data2% %_Data1%Im gettin values of connection string from a .txt file and connection to a database..when i run this bat file it wil call a sql file which wil run queries to delete records from the table....
Below is the SQL file
set feedback off
set heading off
set echo off
set serverout on size 100000
set verify offDECLARE
n NUMBER;
ErrMsg varchar2(80);
BEGIN
begin
if(&1=1) then
insert into web.errorlog values(1,sysdate,'BATCHTNUM IS MISSING IN txt_tnum.txt','ExecProcess','','','','','INFO',0,0,0,0,'AX-SISCVMPAYB01');
COMMIT;
return;
else
insert into web.errorlog values(1,sysdate,'DELETION OF BATCHTNUM &1 STARTED : ','ExecProcess','','','','','INFO',0,0,0,0,'AX-SISCVMPAYB01');
COMMIT;
end if;
end;
begin
delete from web.metdata where BATCHTNUM =&1;
n:=SQL%ROWCOUNT;
COMMIT;
if(n<1) then
insert into web.errorlog values(2,sysdate,'NO RECORDS FOUND IN METDATA TABLE FOR BATCHTNUM &1','ExecProcess','','','','','INFO',0,0,0,0,'AX-SISCVMPAYB01');
COMMIT;
return;
else
insert into web.errorlog values(1,sysdate,n,'ExecProcess','','','','','INFO',0,0,0,0,'AX-SISCVMPAYB01');
COMMIT;
end if;
exception
when others then
ErrMsg := 'Abnormal Error -' || ' SQLCODE : ' || SQLCODE;
insert into web.errorlog values(3,sysdate,ErrMsg,'ExecProcess','','','','','ERROR',0,0,0,0,'AX-SISCVMPAYB01');
rollback;
end;
END;Everything works fine...but the batch is still running it seems..cos the event monitor is showing stil executing...and not completed..so i guess the process is running..how to close the batch file process after successfull execution..
ps:event monitor is a software..instead f double clicking the batch file i can run it from there..
![]() |
swflash oxe
|
log in problem
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.