批处理返回Oracle的表数据

发布时间 2023-04-11 16:47:15作者: 孙犯困

bat:

@ECHO OFF
GOTO choice
:choice
ECHO ===============
ECHO 选择要查询的系统
ECHO 1.准生产集中
ECHO 2.准生产两融
ECHO 3.准生产一柜通
ECHO 4.仿真集中
ECHO 5.仿真两融
ECHO 6.仿真一柜通
ECHO ===============
SET /p a=输入数字:
IF %a%==1 GOTO 1
IF %a%==2 GOTO 2
IF %a%==3 GOTO 3
IF %a%==4 GOTO 4
IF %a%==5 GOTO 5
IF %a%==6 GOTO 6
REM IF 
:1
SET /p p=准生产集中-输入版本:
sqlplus system/password@ORCL @aboss.sql %p% > version.txt
TYPE version.txt
GOTO 1
:2
SET /p p=准生产两融-输入版本:
sqlplus system/password@ORCL @aboss.sql %p% > version.txt
TYPE version.txt
GOTO 3
:3
SET /p p=准生产一柜通-输入版本:
sqlplus system/password@ORCL @ygt.sql %p% > version.txt
TYPE version.txt
GOTO 3
:4
SET /p p=仿真集中-输入版本:
sqlplus system/password@ORCL @aboss.sql %p% > version.txt
TYPE version.txt
GOTO 4
:5
SET /p p=仿真两融-输入版本:
sqlplus system/password@ORCL @aboss.sql %p% > version.txt
TYPE version.txt
GOTO 5
:6
SET /p p=仿真一柜通-输入版本:
sqlplus system/password@ORCL @ygt.sql %p% > version.txt
TYPE version.txt
GOTO 6

sql:

select * from aboss.tprocver where version='&1';
exit