Bat文件更新oracle表 [英] Bat file to update an oracle table
本文介绍了Bat文件更新oracle表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用bat文件更新oracle表。有人可以为它提供示例代码吗?谢谢。
I need to update an oracle table using a bat file. Could someone provide the sample code for it? Thanks.
推荐答案
您可以使用SQLPLUS命令行工具连接数据库,登录并执行文件,但我认为您不能包含命令行上的SQL语句。
您可以将BAT文件ECHO SQL语句放到文件中并执行它。
You can use the SQLPLUS command-line tool to connect to a database, login, and execute a file, but I don't think you can include an SQL statement on the command line.
You can have the BAT file ECHO SQL statements to a file and execute it.
@echo off
@rem Syntax: SQLPLUS.BAT username/password@database "SQL statement" ...
if exist temp.sql del temp.sql
:loop
echo %~2 >> temp.sql
echo ; >> temp.sql
shift /2
if "%~2" neq "" goto loop
echo exit >> temp.sql
sqlplus.exe -S %~1 @temp.sql
或者,编写一个控制台应用程序,允许这很简单。
Alternatively, writing a console application that will allow that is quite simple.
这篇关于Bat文件更新oracle表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文