How to get name of PL/SQL stored procedure being executed?

When executing a PL/SQL stored procedure, is there a way to extract the name of the procedure programatically?
(Similar to the way an Oracle Form can retrieve it's own name via GET_APPLICATION_PROPERTY(CURRENT_FORM_NAME). )
Thanks

Here is one sample ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.17
satyaki>
satyaki>
satyaki>CREATE OR REPLACE PROCEDURE error_test1 AS
  2  BEGIN
  3       dbms_output.put_line(dbms_utility.format_call_stack);
  4  END error_test1;
  5  /
Procedure created.
Elapsed: 00:00:06.45
satyaki>
satyaki>
satyaki>exec error_test1;
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
1D609C14         3  procedure SCOTT.ERROR_TEST1
1D5A89B8         1  anonymous block
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.21
satyaki>
satyaki>Regards.
Satyaki De.

Similar Messages

  • Get owner name inside PL/SQL stored procedure

    Hi,
    how can I get name of the owner of procedure, to the user that executes it?
    Thanks.

    While its true multiple users can have objects with the same name can, its a bad idea to actually do so for the very reason you mentioned. Sometimes we inherit design implementations that we would not use ourselves.
    Another option would be to hard-code the owner name as a package constant. Not a good idea, but it should work if done properly.

  • How to bind arrays to PL/SQL stored procedure using OCI?

    Hi,
    We are having problems trying to bind arrays to PL/SQL stored procedure using OCI. Here is the situation:
    - We have a stored procedure called "GetVEPFindTasks" with the following interface:
    PROCEDURE GetVEPFindTasks (
    p_ErrorCode OUT NUMBER,
    p_ErrorMsg OUT VARCHAR2,
    p_RowCount OUT NUMBER,
    p_VEPFindTasks OUT t_VEPFindTaskRecordTable,
    p_MaxTask IN NUMBER);
    t_VEPFindTaskRecordTable is a record with the following entries:
    TYPE t_VEPFindTaskRecord IS RECORD (
    RTCID NUMBER,
    TransNum NUMBER,
    TransTimestamp VARCHAR2(20),
    Pathname1 image_data.pathname%TYPE,
    Pathname2 image_data.pathname%TYPE,
    Pathname3 image_data.pathname%TYPE,
    OperatorID operator.id%TYPE);
    - Now, we are trying to call the stored procedure from C++ using OCI (in UNIX). The call that we use are: OCIBindByName and OCIBindArrayOfStruct to bind the parameters to the corresponding buffers. We bind all parameters in the interface by name. Now, we do bind the record's individual item by name (RTCID, TransNum, etc.), and not as a record. I don't know if this is going to work. Then, we use the bind handles of the binded record items (only record items such as RTCID, TransNum, and NOT error_code which is not part of the record) to bind the arrays (using OCIBindArrayOfStruct).
    All of the parameters that are binded as arrays are OUTPUT parameters. The rest are either INPUT or INPUT/OUTPUT parameters. Now, when we try to execute, OCI returns with an error "Invalid number or types of arguments" (or something to that sort... the number was something like ORA-06550). Please help...
    Is there any sample on how to use the OCIBindArrayOfStruct with PL/SQL stored procedures? The sample provided from Oracle is only for a straight SQL statement.
    Thank's for all your help.
    ** Dannil Chan **

    As you said:
    You have to pass in an array for every field and deconstruct/construct the record in the procedure. There is no support for record type or an array of records. Can you give me a example? I'am very urgently need it.
    thanks
    email: [email protected]

  • How to get XML output from a stored procedure

    I have a very simple question:
    I would like to write a stored procedure (SP) that will return results in XML format (as a string). My tables in database are not of XML TYPE. But I need XML output.
    ie, SP will run like a typical SP but the only difference will be its output in XML.
    1) is it possible?
    2) if possible, how?
    Please, help
    Omer Koksal

    Thank you Peter, it was a great problem for me !
    Omer Koksal

  • How can I get the printed message of stored procedure in JPA

    Hi, I'm using JPA to invoke stored procedure in database, a segment of the sproc is like below:
    if @create_type != 'a1' and @create_type != 'a'
         begin
         print 'create type must be either ''a1'' if you pass in A1 ID, or ''a'' if you pass in User ID'
         select 0 as "Result"
         endI can get the 0 as the result, it means business operation failed currently, but how could I get the message of 'create type must be either ''a1'' if you pass in A1 ID, or ''a'' if you pass in User ID'?
    That information is important as it indicates why the operation failed.
    Thanks

    how can i get rows count returned by stored procedure in oracle sql developer?
    Procedures do NOT return a value - functions return a value.
    A procedure executes whatever code it contains. That code could contain many queries that produce many row counts.
    Does your procedure take one or more IN, OUT or IN OUT parameters?
    See example 8-1 for an example of executing a procedure that has an OUT parameter.
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/subprograms.htm#CHDBIEEE

  • How to get login ID in SQL?

    Hi,
    How to get login Id in sql?
    such as "select * from table1 where userlogined=:{$loginid$}"?
    Best Regards,
    Jason Gao

    Hi,
    You would need to create a parameter in your report called userloginid select the paramter data type to match that of the datatype this value is stored as in the table.
    then the correct syntax would be select * from table1 where userloginid=:userloginid
    Hope this helps,
    Domnic

  • How to get this output using sql query?

    Hi,
      How to get this output using sql query?
    Sno Name Age ADD Result
    1 Anil 23 delhi Pass
    2 Shruti 25 bangalor Pass
    3 Arun 21 delhi fail
    4 Sonu 23 pune Pass
    5 Roji 26 hydrabad fail
    6 Anil 28 delhi pass
    Output
    Sno Name Age ADD Result
    1 Anil 23 delhi pass
    28 delhi pass

    Hi Vamshi,
    Your query is not pretty clear.
    write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
    Regards,
    Kannan

  • How to send a Varying Array param to a PL/SQL Stored Procedure from Java

    * I am VERY new to jdbc, and even somewhat new to Java
    * I'm using Java 1.5, Oracle 10g.
    * I need to call the following PL/SQL Stored Procedure from Java:
    procedure setEventStatus
    i_deQueueStatus in deQueueStatus_type
    *deQueueStatus_type is the following (an array of deQueueStatus_OBJ):
    CREATE OR REPLACE TYPE deQueueStatus_OBJ as object
    eventID number (20),
    dequeuestatus varchar2(20)
    CREATE OR REPLACE TYPE deQueueStatus_TYPE IS VARYING ARRAY(500) of deQueueStatus_obj
    *I have created a Java object as follows:
    public class EventQueueDeQueueStatus
         long      eventID;
         String      dequeueStatus;
         EventQueueDeQueueStatus(long eventID, String dequeueStatus)
              this.eventID = eventID;
              this.dequeueStatus = dequeueStatus;
    I have an ArrayList of these.
    I need to pass this list to the Stored Procedure. How do I create a java.sql.Array so I can call CallableStatement.setArray to set the parameter? Or do I use something else? I have tried setObject with both the ArrayList and also with a primitive array, but got "Invalid Column Type" both times.
    Any help would be greatly appreciated. I just got this task today, and I have to make it work by Tuesday :-( !
    Thanks,
    Kathy

    Kathy,
    Search the archives of this forum and the JDBC forum for the terms STRUCT and ARRAY and you can find some sample code on the JDBC How-To Documents page and the JDBC Samples which can both be accessed from this page:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    Good Luck,
    Avi.

  • How to write a PL/SQL stored procedure in Oracle to call Webservice

    Can any one pelase send me a code on how to write a PL/SQL stored procedure in Oracle database to call the Webservice ?
    Thanks,
    Rajesh

    Were you able to solve this problem

  • How to call pl/sql stored procedure in JDBC query dialogbox

    Hi,
    how to call pl/sql stored procedure in JDBC query dialogbox(reports 9i) .
    Cheers,
    Raghu

    please refer : Re: problem If you have more doubts, please ask in that question.

  • How to call PL/SQL stored procedure using ODBC?

    Could anyone tell me how can I call PL/SQL stored procedure using
    ODBC? Are there any sample codes?
    Thanx!
    null

    You are correct on all counts, they all should work.
    Oracle Product Development Team wrote:
    : Hi,
    : I don't know the exact syntax in ODBC, but reasoning by analogy
    : with other API's, I'd bet one of the following works
    : (for a call to: procedure my_proc(n1 number, n2 number);):
    : "{ my_proc(1,2); }"
    : "{ call my_proc(1,2); }"
    : "{ begin my_proc(1,2); end }"
    : "begin my_proc(1,2); end;"
    : "begin my_proc(1,2); end"
    : Hope this helps. - Pierre
    : jiangbuf (guest) wrote:
    : : Could anyone tell me how can I call PL/SQL stored procedure
    : using
    : : ODBC? Are there any sample codes?
    : : Thanx!
    : Oracle Technology Network
    : http://technet.oracle.com
    null

  • How to call PL-SQL/stored procedure in Creator

    Anybody can tell how to call PL-SQL/Stored procedures inside creator...

    Hi!!!
    You can see this topic http://forum.sun.com/jive/thread.jspa?threadID=106046
    There is how to call oracle stored procedures. Also I put a lot of links in these topic doing reference stored procedures. I have one that it tells specially how to call oracle stored procedures from java, is in spanish but you can understand the code.;-)
    http://yoprogramador.vampisol.com/index.php?title=pl_sql_oracle_desde_java&more=1&c=1&tb=1&pb=1
    Byeee

  • How to get name of sbRIO programatically

    How to get "name" and "Comment" of sbRIO which I write to sbRIO-9602 in MAX in Identification box (Model, Serial number, MAC address, Name)?
    Solved!
    Go to Solution.

    That shows:
     - IP settings
          - IP adress:        136...etc.
          - DNS name:      MyMaster5                   - THAT IS WHAT I NEED, just in wrong place - in MAX it is not in IP settings, that's why i didn't searched for it there.
          - subnet mask    255.255.255.0
          - gateway          136...
          - DNS server      136...
     - MAC address        00800...
     - serial number        16....
     - system state        Running
     - model name         sbRIO-9602
     - model code          7373
     - password protected restarts?    T/F
     - halt if TCP/IP fails?                   T/F
     - locked?                                   T/F
     - use DHCP?                             T/F
    Still there is no "comment" as in MAX. But that's not so important now.
    I have LW Development system 2009 SP1 Profesional, Realtime Development 2009 SP1
    Thanks very much!

  • How to get name of table from front end

    Hi,
    How to get name of table from front end in EBS 11i?
    thanx
    Ashish

    Hi
    Sandeep is correct. The "Help"/"Record History" will give you the table/view name, but sometimes this particular menu function give me a "Record History is not available here." error message.
    I then use the following menu functions (this will also give you additional information, like column details).
    1) Open Forms
    2) Click on Help/Diagnostics/Examine (*you might have to enter the APPS password at this point)
    3) Change "Block" to "System"
    4) Change "Field" to "Last_query"
    The system will populate the "Value" field with the query that was executed in order to populate the form.
    Regards
    Frank

  • How can get a database like ****.SQL file for test in sqlplus in oracle8i

    How can get a database like ****.SQL file for test in sqlplus in oracle8i,I am a beginner,thanks

    I'll give it a guess as to what it is you want but I'm afraid you'll have to give some more information to go on. I appreciate it's difficult for people who are beginners or who don't have English as their first language.
    Are you trying to run a SQL file? From SQL*plus you can do either of these:
    SQL> start my_file
    or
    SQL> @my_file
    N.B.: if th efile has a .sql extension you don't need to include it, but you do for any other file extension e.g.
    SQL> @myfile.run
    Here is the page Vijay referred to:
    Re: Physical storage Checks & adding disk on server. I hope you find it useful.
    You will more helpful links (including links to the Oracle on-line manuals at this page:
    Re: How to attach a java bean in forms6i
    good luck, APC

Maybe you are looking for

  • Variable from one class to another in a game

    I am making a game in which a user can enter the speed of the initial velocity of a ball. My problem is that when i run the program and enter the speed of the ball in the JTextField, it doesn't actually change the speed of the ball. The ball just use

  • How do I disable the reload on the back button of Firefox and have it display the cached/prior page version?

    Every time I click the "back" button, Firefox reloads the previous page I was on. How do I disable the reload and have Firefox display the cached/prior page version? The whole point of going "back" is to see what we were just looking at.. I don't wan

  • MSS isnt working in SAP R/3 46C

    Hi Experts, I needed some inputs and confirmation on some points. We have a SAP 46C HR Patch 52 as backend and i have installed MSS Business Package 6.01 and EP 60 SP14 and KMC SP14 and TREX 6.1. But the MSS Iviews in Portals are coming blank. We hav

  • How do I get iPhoto to recognize my Sony nex 5R

    When I connect my Sony Nex 5R to my macbook, and launch iPhoto, iPhoto doesn't recognize camera automatically. What am I doing wrong?

  • IMovie 9.0.8 update wont update

    I have an update ready to install for iMovie,but each time i try its telling me to log into account that purchased it,im in that as i have only ever had 1 account ?