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
SQLPLUS and Windows Batch Files
Collapse
X
-
Originally posted by pseit01I 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 -
-
this may be useful to you..Originally posted by pseit01I 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
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_tc v_bk,ct_tcv_ind _local_bk) file='||:FILE_N AME;
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('IMPORT ED ');
INSERT INTO CT_TCV SELECT * FROM CT_TCV_BK WHERE (AC_YEAR_CODE,T CS_TCS_NO,TCS_T CS_DATE,TRIP_BR ANCH_BRANCH_COD E)
commit;
end if;
END;Comment
Comment