Computing.Net > Forums > Windows XP > Help in BATCH file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Help in BATCH file

Reply to Message Icon

Name: vivcn4acid
Date: June 8, 2009 at 23:16:00 Pacific
OS: Xp
Subcategory: General
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=1

set _
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 off

DECLARE

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..



Reply to Message Icon

Related Posts

See More


swflash oxe log in problem



Post Locked

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


Go to Windows XP Forum Home


Google Ads



Results for: Help in BATCH file

difference b/w %%g and %g% in batch file www.computing.net/answers/windows-xp/difference-bw-g-and-g-in-batch-file/176113.html

install print driver in batch file www.computing.net/answers/windows-xp/install-print-driver-in-batch-file/155977.html

Editing variables in batch files. www.computing.net/answers/windows-xp/editing-variables-in-batch-files/135007.html