利用批处理命令调用存储过程

来源:互联网 发布:淘宝东西刚买完就下架 编辑:程序博客网 时间:2024/05/19 10:14

TaplParmSet.ini文件内容:

[root]
root_path=F:/TEST/TAPL/data
[SiteCode]
site_code=TAPL
[PARTS]
parts_path=/PARTS
parts_back_path=/PARTS/back
[PULL_SIGNAL]
pullsignal_path=/PULL_SIGNAL
pullsignal_back_path=/PULL_SIGNAL/back
[POD]
pod_path=/POD
delay_days=0

 

db_connect.ini文件内容:

connect vmith/vmith@toshiba;

RECEIVE_PARTS.bat文件内容:

@echo off
start/b cmd /c

echo RECEIVE_PARTS is in processing,please wait...

for /f "delims== tokens=1*" %%a in ('more ^<ini/TaplParmSet.ini^|find /i "root_path"') do set root_path=%%b
for /f "delims== tokens=1*" %%a in ('more ^<ini/TaplParmSet.ini^|find /i "parts_path"') do set child_path=%%b
for /f "delims== tokens=1*" %%a in ('more ^<ini/TaplParmSet.ini^|find /i "parts_back_path"') do set child_back_path=%%b
for /f "delims== tokens=1*" %%a in ('more ^<ini/TaplParmSet.ini^|find /i "site_code"') do set site_code=%%b

set root=%root_path%%child_path%
set back=%root_path%%child_back_path%
set log_path=%back%/pack.log

set d=%date:~0,10%
set d=%d:-=%
set t=%time:~0,8%
set t=%t:-=%

echo "-------RECEIVE_PARTS----Begin %p%%d% %t%--------------------------" >>%log_path%
echo @ini/db_connect.ini;>pack.sql
echo SET SERVEROUTPUT ON;>>pack.sql
echo var o_sts_parts number;>>pack.sql
echo var o_err varchar2(200);>>pack.sql
echo exec PACK_TAPL_SEND_RECEIVE.PROC_READ_PARTS_DAT('%site_code%','SYSTEM','%root%','%back%',:o_sts_parts,:o_err);>>pack.sql
echo print o_sts_parts;>>pack.sql
echo print o_err;>>pack.sql
echo exit;>>pack.sql

sqlplus/nolog   @pack.sql                                            >>%log_path%

del pack.sql

if exist *.log (del *.log)

set d=%date:~0,10%
set d=%d:-=%
set t=%time:~0,8%
set t=%t:-=%
echo "-------RECEIVE_PARTS----End %p%%d% %t%----------------------------" >>%log_path%
echo.                                                                >>%log_path%

echo RECEIVE_PARTS is completed.
echo.

 

pack.log文件内容:

"-------RECEIVE_PARTS----Begin 2009/05/18 18:54:45--------------------------"

SQL*Plus: Release 9.2.0.1.0 - Production on 月 May 18 18:54:45 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

接続されました。

PL/SQLプロシージャが正常に完了しました。


O_STS_PARTS
-----------
   0


O_ERR
----------------------------------------------------------------


Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Productionとの接続が切断されました。
"-------RECEIVE_PARTS----End 2009/05/18 18:54:46----------------------------"
                                                               

原创粉丝点击