1

I would like to run a script in SQL Developer (for Oracle 12c) which creates 2 types and a stored procedure from a single SQL file. Something like:

CREATE OR REPLACE TYPE t_arr_five IS VARRAY(5) OF INTEGER;

CREATE OR REPLACE TYPE t_arr_ten IS VARRAY(10) OF INTEGER;

CREATE OR REPLACE PROCEDURE my_proc(
  p_a IN t_arr_five,
  p_b IN t_arr_ten
) AS
BEGIN
  -- ...
END;

When I run this script, I get the error: Error(3,1): PLS-00103: Encountered the symbol "CREATE"

Due to submission requirements, I must submit a single, runnable script (.SQL file), so I cannot execute one statement at a time.

What is the correct syntax to achieve this?

nluka
  • 91
  • 6
  • 1
    maybe this will help you https://www.thatjeffsmith.com/archive/2012/06/running-multiple-queries-in-oracle-sql-developer/ – nbk Oct 11 '22 at 23:05

1 Answers1

0

Turns out the solution is quite simple. All that's needed is to add a / after each CREATE statement on its own line:

CREATE OR REPLACE TYPE t_arr_five IS VARRAY(5) OF INTEGER;
/
CREATE OR REPLACE TYPE t_arr_ten IS VARRAY(10) OF INTEGER;
/
CREATE OR REPLACE PROCEDURE my_proc(
  p_a IN t_arr_five,
  p_b IN t_arr_ten
) AS
BEGIN
  -- ...
END;
nluka
  • 91
  • 6