Execute script file directly in PLSQL

1

I have arquivo.sql , which has thousands of lines of scripts, containing, creations, changes, etc.

I need to run this file directly in PLSQL in SQL Window , and not can be via Command Window .

Via Command Window , this works:
@c:\arquivo.sql

Via SQL Window , I tried the following ways, but to no avail:

1. Running directly

@c:\arquivo.sql

Error:

  

ORA-00900: Invalid SQL statement

2. Running directly

EXECUTE IMMEDIATE '@c:\arquivo.sql'

Error:

  

ORA-00900: Invalid SQL statement

3. Creating a procedure

CREATE OR REPLACE PROCEDURE p_run_script IS
BEGIN
  EXECUTE IMMEDIATE '@c:\arquivo.sql';
END p_run_script;
/
BEGIN
    p_run_script;
END;
/

Error:

  

ORA-00900: Invalid SQL statement ORA-06512: in
  "P_RUN_SCRIPT", line 3 ORA-06512: in line 2

Note: I can not send this file to the server, nor create a directory in oracle, or use dbms_pipe .

It does not have to be an answer to the script and it's complete, but if you talk only what you search for, it's already a great help.

    
asked by anonymous 19.07.2017 / 16:31

1 answer

1

Good afternoon, I managed to do this:

1 - Opening the command window option

2 - SQL> @"c:\arquivo.sql"

Note that the "@" is outside the quotation marks and has no ";".

    
28.02.2018 / 17:40