How can I run a SQL script from a local disk on the server?

I am connected to the server with sql,

I did,

SQL>@/path/to/file.sql

but got an error SP2-0310: unable to open file.

+3
source share
4 answers

First, try to find the folder where the script is located, then connect to the server and run SQL> file.sql. It works with MySQL.

+1
source

try double quotes throughout the subject after @sign @ "..."

+1
source

.sql ? , .

+1

I'm not sure how to do this on Unix, but if you are starting on Windows, go to the "Icon Properties" that you use to run SQL * Plus and set the "Start at:" field to include the path to your script. Assuming the file is on the dive A: for this example, you would put A: \ Path \ to \ File Then just use @ file.sql at the prompt (or just @file, since the default extension is ".sql").

+1
source

All Articles