473,499 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLPLUS and Windows Batch Files

1 New Member
I am looking for an example of how to capture a return code from within a Windows Batch (.bat) file that executes a SQLPLUS command. The SQL script will either exit with EXIT(0) or EXIT(n). If the exit is greater than ZERO, then the .BAT file will need to perform additional logic
Sep 28 '07 #1
4 13936
fhkhan78
5 New Member
I am looking for an example of how to capture a return code from within a Windows Batch (.bat) file that executes a SQLPLUS command. The SQL script will either exit with EXIT(0) or EXIT(n). If the exit is greater than ZERO, then the .BAT file will need to perform additional logic

simply right click on the batch file and click on edit the file will be open in the note pad
Jan 12 '08 #2
kbilal
1 New Member
Use host command to execute the batch file like the example given below:

host(abc.bat);
Jan 18 '08 #3
Orawonster
1 New Member
%ERRORLEVEL% might be what you want to look into
Feb 8 '08 #4
subashsavji
93 New Member
I am looking for an example of how to capture a return code from within a Windows Batch (.bat) file that executes a SQLPLUS command. The SQL script will either exit with EXIT(0) or EXIT(n). If the exit is greater than ZERO, then the .BAT file will need to perform additional logic
this may be useful to you..

PROCEDURE rcv_data IS
h9 varchar2(1200);
fnd varchar2(1);
fr number;
lr number;

BEGIN
fr:=0;
lr:=0;

H9:='imp80 CORE/CORE@ibm tables=(ct_tcv_indent_bk,ct_tcv_bk,ct_tcv_ind_loca l_bk) file='||:FILE_NAME;
MESSAGE(H9);
MESSAGE(H9);
host(h9);

SELECT 'X' INTO FND FROM USER_TABLES WHERE TABLE_NAME='CT_TCV_INDENT_BK';

select count(*) into fr from CT_TCV_INDENT;

IF SQL%NOTFOUND THEN
MESSAGE('ERROR - 9898 NOT IMPORTED ');
ELSE

MESSAGE('IMPORTED ');
INSERT INTO CT_TCV SELECT * FROM CT_TCV_BK WHERE (AC_YEAR_CODE,TCS_TCS_NO,TCS_TCS_DATE,TRIP_BRANCH_ BRANCH_CODE)
commit;
end if;

END;
Feb 8 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
37895
by: 91YJ_Renegade | last post by:
why can I TNSPING but I can not connect using SQLPLUS? Oracle 10g Slackware 10 install 2.6.6 kernel exports ORACLE_BASE=/home/oracle ORACLE_HOME=/home/oracle/product/10g ORACLE_SID=ora9i...
0
3881
by: Doug | last post by:
Hi, I'm having problems using sqlplus on OS X. I'm trying to connect to my college's server. They supplied the tnsnames.ora. If I run 10g client in Windows (via VirtualPC on the Mac, very...
0
2373
by: tyousaf | last post by:
Hi i am new to mysql and mysql++, i have installed mysql server, it is running fine. i also installed "mysql++-1.7.9gcc3.2-2.i386.rpm" (i have gcc 3.3) , first of all as the readme file says to do...
7
9043
by: erniedude | last post by:
Hi, I'm a newbie and I was wondering if anyone knew a (Python) script to run 4 batch files, one after the other (assuming the directories are known). It would be better if all 4 batch files...
6
11190
by: Charles Neitzel | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
1
3132
by: Charles | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
3
7468
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
0
1819
by: Mark D Powell | last post by:
getamit23@rediffmail.com (Amit Kapoor) wrote in message news:<c33bca54.0307090046.7698321f@posting.google.com>... The Windows version of sqlplus should be part of the Oracle client install for...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.