Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8951021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:34:15+00:00 2026-06-15T13:34:15+00:00

I have an oracle procedure which calls few other procedures. PROCEDURE1 PROCEDURE2 PROCEDURE3 ..

  • 0

I have an oracle procedure which calls few other procedures.

PROCEDURE1

PROCEDURE2
PROCEDURE3
..

Now what happens is that PROCEDURE2 is performing DDL (EXECUTE IMMEDIATE 'DDL PROCESS' ) on some dependent tables being used in subsequent procedures 3 and onwards. This runs fine until it hits PROCEDURE3 where it throws ORA-06508 - Program / Unit being called not found.

We can not modify it not to use DDL, We have to use them. I have tried recompiling after DDL statements but it does not work (ALTER PROCEDURE PROCEDURE3 RECOMPILE) neither in PROCEDURE1 or in PROCEDURE2.

I doubt that PROCEDURE1 itself becomes invalid and compiling that on runtime will cause endless loop. I have tried, does not works.

So I need to use some trick that can make these procedures valid again on runtime after DDL is done on dependent objects.

Thanks in advance for whoever participates to answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:34:15+00:00Added an answer on June 15, 2026 at 1:34 pm

    In this case, as in many other cases, would be better to create a package instead of a bunch of stand-alone procedures. Packages break dependency chain. Here is an example:

        SQL> create table tb_t(
         2    col1 number
         3  )
         4  ;
    
        Table created
    
    1. Stand-alone procedures

      SQL> create or replace procedure Proc1
        2  is
        3  begin
        4    execute immediate 'alter table tb_t add (col2 number)';
        5  end;
        6  /
      

      Procedure created

      SQL> create or replace procedure Proc2
       2  is
       3    l_var number;
       4  begin
       5    select count(*)
       6      into l_var
       7      from tb_t;
       8    dbms_output.put_line(to_char(l_var));
       9  end;
       10  /
      
       Procedure created
      
       SQL> begin
        2    proc1;
        3    proc2;
        4  end;
        5  /
      

    and we are getting

         ORA-06508: PL/SQL: could not find program unit being called
    
    1. Package

      SQL> create or replace package test_pkg
        2  is
        3    procedure proc1;
        4    procedure proc2;
        5  end;
        6  /
      
      Package created
      
      SQL> create or replace package body test_pkg
        2  is
        3    procedure proc1
        4    is
        5    begin
        6      execute immediate 'alter table tb_t add (col3 number)';
        7    end;
        8  
        9    procedure proc2
       10    is
       11     l_var number;
       12    begin
       13      select count(*)
       14        into l_var
       15        from tb_t;
       16      dbms_output.put_line(to_char(l_var));
       17    end;
       18  
       19  end;
       20  /
      
       Package body created
      
      
       SQL> begin
         2    test_pkg.proc1;
         3    test_pkg.proc2;
         4  end;
         5  /
      
         0
      
         PL/SQL procedure successfully completed
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Oracle trigger which is calling a stored procedure that has PRAGMA
I have a wrapper procedure(proc_main) that calls some procedures within. create or replace Procedure
We have an internal application based on .Net which calls certain procedures in Oracle
I have a Oracle procedure to which I have to pass a datetime value
I have a stored procedure in oracle which is using cursor.Its fetching the data
I have a situation where I have an Oracle procedure that is being called
I have the following iBatis mapping for an Oracle Stored Procedure that returns a
I have a question about stored procedures in Oracle. Below is the stored procedure
I have a oracle procedure which should return a concatenated string of all the
I have to write an Oracle procedure which should invoke an Oracle function returning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.