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

  • SEARCH
  • Home
  • 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 8966719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:04:47+00:00 2026-06-15T17:04:47+00:00

Is there a variable name that stores name of the stored procedure currently running?

  • 0

Is there a variable name that stores name of the stored procedure currently running? Something similar to $0 in Unix.

CREATE OR REPLACE
PROCEDURE my_sproc(
  param1 IN NUMBER,
  )
  AS      
  BEGIN
    exec other_sproc(XXX);
  END;
END;

XXX <- stores the string “my_sproc”.

  • 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-15T17:04:48+00:00Added an answer on June 15, 2026 at 5:04 pm

    Depending on the Oracle version, you may be able to use conditional compilation and $$PLSQL_UNIT

    If other_sproc just prints out the value passed in

    create or replace procedure other_sproc( p_in in varchar2 )
    as
    begin
      dbms_output.put_line( p_in );
    end;
    /
    

    then in Oracle 11g, you can use $$PLSQL_UNIT in the caller

    SQL> create or replace procedure my_sproc
      2  as
      3  begin
      4    other_sproc( $$PLSQL_UNIT );
      5  end;
      6  /
    
    Procedure created.
    
    SQL> exec my_sproc;
    MY_SPROC
    
    PL/SQL procedure successfully completed.
    

    This doesn’t work as well when you are using packages though (and your stored procedures should almost always be in packages) because the $$PLSQL_UNIT will be the package name not the procedure name.

    Note as well that you do not use EXEC in a PL/SQL block. EXEC is a SQL*Plus command. You simply call other_sproc like I do here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i know there is a variable, function, or stored procedure that you can use
I am trying to write a stored procedure that takes a table name as
I have a stored procedure that takes in the name of a table as
Lets suppose there is a stored procedure that has 3 params. Out of all
Is there any possibility of giving variable name to hex/rgb numbers in .qss file
I have a variable name subject. For each unique subject there are 240 response
Possible Duplicate: Get variable name. javascript “reflection” Is there a way to know the
If I set a session variable in Django, like: request.session[name] = name Is there
Is there a variable or a preprocessor constant that allows to know that the
For some reason there's a variable called d that is defined immediately after I

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.