1

I have finally connected to sqlplus under windows with command:- sqlplus -S "dbname/dbpassword@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=)(Port=1521))(CONNECT_DATA=(SID=SID_OF_DB)))" (Can't connect with configuration file but command line works well for me.)

But I'm not able to execute sql file along with the command.

It is definitely possible to execute .sql file with directive << under linux, but how do I execute in windows?

I'm using sqlplus to generate csv within batch file and importing to mysql. Presently using login.sql as alternate.

4

2 回答 2

3

You can connect and execute using the '@' followed by your file name as mentioned by Chris. You can use it as follows.

sqlplus -S user/password@SID_OF_DB @oracle.sql

于 2013-08-12T13:22:08.317 回答
2

You should be able to run a SQL file by adding @filename onto the end of your command to open sqlplus. If the file is not in your current working directory you will need to include the path. Also if there are any spaces in the name or path then enclose the whole path within double quotes.

Some more info about the command line options can be found here.

于 2013-08-12T08:37:01.830 回答