读取包含插入查询的文本文件,并在shell脚本中运行那些查询[重复]

问题描述 投票:0回答:1
我有一个名为abc.txt的文本文件,其中包含几个插入查询,我想阅读此文件并使用Shell脚本运行那些查询。

我目前的做法是:

1.reading the file line by line 2.connecting to sqlplus using username and password 3.running the command

我的要求是,我想进行一次连接,我不想进行多次连接。

我如何通过一个连接运行插入查询?

bash shell unix sqlplus
1个回答
0
投票
尝试一下:

sqlplus username/password@host:port/service < abc.txt

© www.soinside.com 2019 - 2024. All rights reserved.