Home > database >  How to make up SQLPLUS when executing scripts using relative directory?
How to make up SQLPLUS when executing scripts using relative directory?

Time:09-20

I write an SQL script file the SQL, under the project folder, content is
@ @ tables/create_table. SQL
Then, I built the tables in the script file directory folder, the folder created create_table. SQL file, inside is writing the script for the create table table_a;
I again to up sqlplus directory, create a tables folder, the folder created create_table. SQL file, inside is writing the script for the create table table_b;
Results directly run up sqlplus and type the command
SQL> Conn username/password
The connected,
SQL> @ engineering/install directory. SQL

The table is created,

Results I see create is table_b table,

According to the principle that I want it is relatively directory script execution, should create table_a table, because I am in the SQL file using the @ @
Is it not, or say what should use other method?

Could you tell me where the how to script the relative directory lookup and perform the related script?

CodePudding user response:

The SQL
Create_table. SQL

The two files, should be put in the same directory, do not use directories,
  • Related