I would like to know the procedure name

15 pts.
Tags:
PL/SQL
How to know the procedure name of itself? for example, ------------------------------ create or replace procedure my_proc1 is begin dbms_output.put_line (' procedure name =>' || xxxxxx ) ; end; ----------------------------- i want to print 'my proc1' as procedure name through dbms_output.put_line.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Gregori,

I am not sure if there is any Oracle provided way of determining this, but it does appear you have answered your own question. If you created the procedure you can create a dbms_output line to put whatever it is out. If you want it to be dynamic, so you can copy the few lines into various procedures then you could make the procedure name as an in paramter and do basically what you are doing now except like this :

dbms_output.put_line (‘ procedure name =>’ || p_proc_name) ;

where p_proc_name is the name of the input parameter.

If that does not work for you, perhaps you could give some background information as to what your overall needs and intentions are for the output line.

Regards,

Robert

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Miker
    You could also look at the DBMS_UTILITY package Things like FORMAT_CALL_STACK or for exceptions FORMAT_ERROR_STACK and FORMAT_ERROR_BACKTRACE
    10 pointsBadges:
    report
  • MiguelPascoe
    If you are using 10g (it might exist prior) use the $$PLSQL_UNIT compiler directive:
    dbms_output.put_line (' procedure name =>' || $$PLSQL_UNIT) ;
    Cheers, Miguel
    40 pointsBadges:
    report
  • Gregori
    Dear Mr. MiquelPascoe; thank you very much on your valuable answer. I solved my problem regarding displaying "procedure name" through your comment using $$PLSQL_UNIT. Best Regard; Baek.
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following