1

I have looked it up already but couldn't find the right solution for my question. I have many Procedures which copy tables from one database Schema called 'source' into another Schema on the same database called 'target'. The Procedures themself work if I execute them individually. Now I want to execute them with only one command. The problem is I don't know how. I want to do that because there are many procedures and it is annoying to execute them all individually. It would be nice if someone could help me out. Thanks in advance :)

My approach (which is obviously wrong) was:

CREATE OR REPLACE PROCEDURE COPY_TABLES
IS
BEGIN
EXEC COPY_EAKTEPERSON;
EXEC COPY_EANDEREANSRPUECHE;
EXEC COPY_EANDEREBHBERECHT;
EXEC COPY_EBEIHILFEBEMSATZ;
EXEC COPY_EBESCHAEFTIGUNG;
EXEC COPY_EDIENSTSTELLE;
EXEC COPY_EEIGENBEHALT;
EXEC COPY_EPFLEGEVERS;
EXEC COPY_ESEHSCHAERFE;
EXEC COPY_EVERSLEISTUNG;
EXEC COPY_EWOHNISITZ;
EXEC COPY_EPERSON;
END;
Cœur
  • 37,241
  • 25
  • 195
  • 267
AnSuS
  • 45
  • 8

1 Answers1

3

A procedure calling another procedure.

create or replace procedure COPY_TABLES(                                         
ret out varchar2) as
   error      varchar2(1000);
begin
   COPY_EAKTEPERSON();
   COPY_EANDEREANSRPUECHE();
   COPY_EANDEREBHBERECHT();
   COPY_EBEIHILFEBEMSATZ();
   COPY_EBESCHAEFTIGUNG();
   COPY_EDIENSTSTELLE();
   COPY_EEIGENBEHALT();
   COPY_EPFLEGEVERS();
   COPY_ESEHSCHAERFE();
   COPY_EVERSLEISTUNG();
   COPY_EWOHNISITZ();
   COPY_EPERSON();
   ret := ''
   return;
exception
   when others then
   error_info := sqlerrm;
   ret := error_info;
end COPY_TABLES;
M.Laida
  • 1,818
  • 1
  • 13
  • 19