Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create more than one procedure in a SQL file?

I want to create more than one procedure in a SQL file, ie:

create or replace procedure pro1 as 
begin
   null;
end pro1;

create or replace procedure pro2 as 
begin
   null;
end pro2;

create or replace procedure pro3 as 
begin
   null;
end pro3;

Doing this throws an error:

Error(10,1): PLS-00103: Encountered the symbol "CREATE"

How can I do this? Creating a package ins't an option due to some limitations.

like image 539
x.509 Avatar asked Nov 02 '11 17:11

x.509


People also ask

How can I get multiple stored procedure scripts in SQL Server?

Option 1: Use the scripting wizard Right-click the db --> tasks --> Generate scripts --> go through the wizard. Option 2: Open the stored procedures folder in SSMS (in the object explorer details window) You can use shift click to select all the stored procedures and you can then right_click and script them to a file.

Can there be more than one procedure with the same name?

In other words, you can't have two procedures with the same name and input argument data types but different output argument types. The owner or a superuser can replace the body of a stored procedure with a new one with the same signature.


1 Answers

Add /

create or replace procedure pro1 as 
begin
   null;
end pro1;
/

create or replace procedure pro2 as 
begin
   null;
end pro2;
/

create or replace procedure pro3 as 
begin
   null;
end pro3;
/
like image 164
cagcowboy Avatar answered Oct 25 '22 08:10

cagcowboy