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
.
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.