How to find the type of objects contained in a Stored Package?

Hello,
I need to populate all the procedures and functions contained in a package. I have rewritten a query like this
"SELECT PROCEDURE_NAME FROM ALL_PROCEDURES WHERE OBJECT_NAME = 'MYPACKAGENAME'
Above Query returns a record, having NULL PROCEDURE_NAME value. Why?
I also want the 'type' of object (stored procedure/function ) contained in the a package.
How to fetch it?
Following query always returns object type 'PACKAGE', which is of no use for me. I want to know if it is stored procedure or function.
SELECT PROCEDURE_NAME, *OBJECT_TYPE* FROM ALL_PROCEDURES WHERE OBJECT_NAME = 'MYPACKAGENAME'
Cheers,
Machhindra

Hi,
Just thinkin Out of Box way... :-
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
F:\Documents and Settings\Administrator>sqlplus scott/tiger@service1
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 26 21:49:03 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> CREATE OR REPLACE PACKAGE emp_mgmt AS
  2  FUNCTION hire (last_name VARCHAR2, job_id VARCHAR2,
  3     manager_id NUMBER, salary NUMBER,
  4     commission_pct NUMBER, department_id NUMBER)
  5     RETURN NUMBER;
  6  FUNCTION create_dept(department_id NUMBER, location_id NUMBER)
  7     RETURN NUMBER;
  8  PROCEDURE remove_emp(employee_id NUMBER);
  9  PROCEDURE remove_dept(department_id NUMBER);
10  PROCEDURE increase_sal(employee_id NUMBER, salary_incr NUMBER);
11  PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER);
12  no_comm EXCEPTION;
13  no_sal EXCEPTION;
14  END emp_mgmt;
15  /
Package created.
SQL>
SQL> SELECT PROCEDURE_NAME FROM ALL_PROCEDURES WHERE OBJECT_NAME = 'EMP_MGMT';
PROCEDURE_NAME
CREATE_DEPT
HIRE
INCREASE_COMM
INCREASE_SAL
REMOVE_DEPT
REMOVE_EMP
6 rows selected.
Now you requirement
SQL> SELECT PROCEDURE_NAME,A.OBJECT_NAME,OBJECT_TYPE FROM ALL_PROCEDURES A, USER_OBJECTS UO WHERE UO.OBJECT_NAME = A.O
BJECT_NAME AND A.OBJECT_NAME='EMP_MGMT';
PROCEDURE_NAME                 OBJECT_NAME
OBJECT_TYPE
REMOVE_EMP                     EMP_MGMT
PACKAGE
REMOVE_DEPT                    EMP_MGMT
PACKAGE
INCREASE_SAL                   EMP_MGMT
PACKAGE
PROCEDURE_NAME                 OBJECT_NAME
OBJECT_TYPE
INCREASE_COMM                  EMP_MGMT
PACKAGE
HIRE                           EMP_MGMT
PACKAGE
CREATE_DEPT                    EMP_MGMT
PACKAGEIn oder to know the type of Object why don't you simple decribe in order know the Object definition it self.. instead of firing queries...Don't you thinl it easy of use.. !! you will get better Explanation about your Package
SQL> desc EMP_MGMT;
FUNCTION CREATE_DEPT RETURNS NUMBER
Argument Name                  Type                    In/Out Default?
DEPARTMENT_ID                  NUMBER                  IN
LOCATION_ID                    NUMBER                  IN
FUNCTION HIRE RETURNS NUMBER
Argument Name                  Type                    In/Out Default?
LAST_NAME                      VARCHAR2                IN
JOB_ID                         VARCHAR2                IN
MANAGER_ID                     NUMBER                  IN
SALARY                         NUMBER                  IN
COMMISSION_PCT                 NUMBER                  IN
DEPARTMENT_ID                  NUMBER                  IN
PROCEDURE INCREASE_COMM
Argument Name                  Type                    In/Out Default?
EMPLOYEE_ID                    NUMBER                  IN
COMM_INCR                      NUMBER                  IN
PROCEDURE INCREASE_SAL
Argument Name                  Type                    In/Out Default?
EMPLOYEE_ID                    NUMBER                  IN
SALARY_INCR                    NUMBER                  IN
PROCEDURE REMOVE_DEPT
Argument Name                  Type                    In/Out Default?
DEPARTMENT_ID                  NUMBER                  IN
PROCEDURE REMOVE_EMP
Argument Name                  Type                    In/Out Default?
EMPLOYEE_ID                    NUMBER                  IN
SQL>- Pavan Kumar N

Similar Messages

  • How to find the difference in object definition between two databases

    Hi,
    Can any one suggest me how to find the difference in object definition between two different databases. Is there any tool or by OEM? If so how?
    Regards
    Naveen

    this link may be helpful...
    http://www.dbspecialists.com/scripts.html

  • How to find the columns and tables used in a stored procedure?

    Hi,
    Can someone suggest how to find the columns and tables used within a stored procedure?
    Thanks
    VBK

    For example:
    SQL> create or replace
      2    procedure p1
      3      is
      4          cnt number;
      5      begin
      6          select count(*) into cnt from emp;
      7  end;
      8  /
    Procedure created.
    SQL> select  referenced_owner,
      2          referenced_name
      3    from  dba_dependencies
      4    where owner = 'SCOTT'
      5      and name = 'P1'
      6      and referenced_type = 'TABLE'
      7  /
    REFERENCED_OWNER               REFERENCED_NAME
    SCOTT                          EMP
    SQL> SY.

  • How to find the Last modified date and time of a package

    Hi,
    We need a clarification on how to find the Last modified date and time of a package in Oracle. We used the example below to explain our scenario,
    Lets consider the following example
    Let A, B be two packages.
    Package A calls the package B. So A is dependent on B.
    When A is compiled the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS gets updated.
    Now there a modification in package B so it is compiled. There is no modification in package A.
    Now when the package A is executed the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS gets updated but we did not make any change in Package A. Now we need to find last modified date and time of the package A . So we can not rely on the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS . Can u please tell us any other solution to get last modified date and time of the package A .
    Regards,
    Vijayanand.C

    Here is an example:
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 10:57:32 2004-05-20:10:57:32 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 10:59:04 2004-05-20:10:59:04 VALID
    SQL> CREATE OR REPLACE PROCEDURE A AS
    2 BEGIN
    3 NULL;
    4 NULL;
    5 END;
    6 /
    Procedure created.
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 11:01:28 2004-05-20:11:01:28 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 10:59:04 2004-05-20:10:59:04 INVALID
    SQL> EXEC B
    PL/SQL procedure successfully completed.
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 11:01:28 2004-05-20:11:01:28 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 11:01:53 2004-05-20:11:01:53 VALID
    Note that the date under the column 'created' only changes when you really create or replace the procedure.
    Hence you can use the column 'created' of 'user_objects'.

  • How to distinguish the type of object that came in the JMS message.

    I have a queue that has 4 different object's being sent through messages across the queue. Depending on the object that comes in I need to determine what process to start. I have created a master project with a single queue listener that will start the master process. Either before the listener starts the master process or after the master process starts in a method I need to figure out the type of object that was contained in that method. In Java its simply if(msg InstanceOf ObjectB), else if (msg InstanceOf ObjectC)....and so forth. What is the way this would be done in ALBPM6.0's fuego code or whatever it is called?

    In case you had an ID, which is assigned automagically on emp, this could also be written like this:
    create trigger emp_trig
    after insert or update or delete on emp
    for each row
    begin
    insert into emp_log values(
    :new.empno, :new.ename,
    decode(nvl(:old.id,-1),-1,'Insert',decode(nvl(:new.id,-1),-1,'Delete','Update')), sysdate);
    end;
    ..where -1 is a value you do not expect to be propagated ever in id column. Also, :new.empno and :new.enmae will be null if the dml being executed is a delete statement.

  • How to find the text id & object name to be used with read_text  ?

    Hi All
    how to determine the text id & object name associated with PO to be used with FM read_text  ?
    Regards
    Jaman

    Hi,
    For PO there will be Header Texts and Item texts.
    For header texts just Take the PO number as TDNAME.
    for Item texts Conactenate the PO number and Item Number and use as TDNAME.
    in ME23N Go to any text.Double click on it
    It will take you to text editor.
    GOTO-> header
    it will display the TEXT  ID,TEXTNAME,LANG  and TEXT OBJECT etc
    Similarly for every  text you will find and use;
    Regards,
    Anji

  • How to find the list of queries containing a Particular Infoobject

    Hi all,
    I have requirement to find the list of queries and workbooks which contains a Particular Infoobject. Please advice is there any Database table or Programs exists to find..
    Thanks in advance
    GAMY..

    Hi,
    Thanks for your replies.
    I have tried the oprion already..(RSD1 > Type in the name of the InfoObject and from the menu Edit > choose Where Used list.) but no use. It doesn't show the list of queires..It shows only the data targets.
    I would like to know is there any table to achieve the requirement.
    Thanks in advance
    Ganesh(GAMY)

  • How to find the type of a variant...

    I'm trying to programatically read the "VersionInfoFileVersionBuild" tag's value associated with a Build Specification.  This is the fourth number in the overall version number. i.e if the version number is "1.4.3.7", the VersionInfoFileVersionBuild is 7.
    I tried using the "Get Tag" method, with this tag, but the value is returned as a variant.  I've tried converting this variant to data and I keep getting the following error: "LabVIEW:  The data type of the variant is not compatible with the data type wired to the type input."
    I've tried every numeric type and even strings and the same error keeps coming up.  Can someone tell me what IS the type of the value associated with the "VersionInfoFileVersionBuild", or how do I find it?

    Hey intvsteve,
    Thanks for trying to help.  I had already tried using I32 as the type input for the "Variant to Data.vi" and it had not worked.  I have even tried flattening the variant to a string and scanning the string.  None of it has worked.  For whatever reason, I'm getting a '4' back for the first element in my "Type String" array which indicates the type is a 64-bit integer.  But that's not working for me either.  I wonder if the problem has to do with this note in the Help for the Type Descriptors:
    "Note  The format in which LabVIEW stores type descriptors changed in LabVIEW 8.0. LabVIEW 7.x stores type descriptors in 16-bit flat representation. LabVIEW 8.0 stores type descriptors in 32-bit flat representation. The following information applies if you use the Convert 7.x Data mode of the Flatten to String function.Note  The format in which LabVIEW stores type descriptors changed in LabVIEW 8.0. LabVIEW 7.x stores type descriptors in 16-bit flat representation. LabVIEW 8.0 stores type descriptors in 32-bit flat representation. The following information applies if you use the Convert 7.x Data mode of the Flatten to String function."
    I'm using LabVIEW 8.0.  Any other thoughts?

  • How to Find the OID (Oracle Object ID's) which are already in use.

    Hi,
    I am importing a dump from source to destination with imp command as the dump has been exported using exp command.
    I ran the dump and it got hanged once.
    So, I am rerunning it again, My import failed again and I am getting an error that OID is already is present.
    I need to know how we can find the OID's which are already used, so that I can find those objects are flush them before the importing the dump.
    Thanks,
    Nagendra Reddy.

    Have you thought about using an ldif to export your directory into another?
    -Kevin

  • How to find the type of webserver being configured for use with ColdFusion

    Hello,
    Where can I check to see the type of server that ColdFusion is configured to run currently? I have an existing installation of CF 9.0.1, which I will be removing and installing CF 9.0.2. During instalation of 9.0.2, I would need to specify the server to be used - ColdFusion server / Apache/ IIS etc. My question is, where should I see in the existing CF 9.0.1 to understand the server that is currently being used.
    Thanks!

    You could use the Web Server Configuration Tool. Assuming you are on Windows, the path to launch it is usually
    Start => Programs => Adobe => ColdFusion 9 => Web Server Configuratiol Tool
    In fact, you could use this tool to add or remove web servers.

  • How to find the date when object is moved from quality to production server

    Hi Experts,
    I am working with BADI ZMM_PUR_REQ_PROC_001-Method Check and BADI ZME_PROCESS_PO_CUST-Method Check.
    I need to add a check that a particular logic should be implemented only after this object is moved to the production server.
    How can i check the date when an object (in my case this BADI) is moved to the production server?
    <Removed by moderator>
    Thanks in advance.
    Edited by: Vinod Kumar on Aug 1, 2011 10:55 AM

    Hi Sakshi,
    So your reqt is that the documents created after your Transport implementation date should pass the check and others (old ones) should ignore.
    I will recommend, if at all possible, to make all the old documents compatible to your check by doing a separate initial loading /one time activity to avoid this kind of hardcoding.
    IF not at all possible to do so, then I think you should better hardcode your Transport req number and fetch date (AS4DATE) from E070 table and only if any entry exists, use that date as your required date. I believe this will be the date of transport imported in the target system.
    You can avoid hardcoding Transport number by picking latest transport with respect to your object (BADI) using E071 table, but that will go wrong once you send any future changes in this BADI to Prod, so better to hardcode the transport.
    BR,
    Diwakar

  • How to find the type of gui being used?

    We have a custom t code and the pop ups are not working in webgui.
    We want to restict the t code from getting triggered in the webgui.
    So it should only be used in wingui.
    The checkbox in SE93 did not help.
    So how to restrict this.?

    Hi,
    GotoSE93>(TCODE)
    Check for Gui Support
    Only check SAP GUI FOR WINDOWS.
    Check if Easy Web transaction is selected.
    Radio Button:Professional User Transaction should be selected.
    This will resolve the issue.
    regards,
    Gurpreet

  • How to find the number of references created for a given  object ??

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please do not post the same question multiple times.
    As for your original question, there is no direct way to do it.
    Especially not the way you phrased it,
    since objects don't have "names".
    Applications also don't have "names".
    They have classes and instances.
    Also, there are 2 related issues, and I'm not sure which one is the one you asked.
    #1. Finding the number of references to the same object.
    Eg.
    Map<String,String> a = new HashMap<String,String>();
    Map<String,String> b = new HashMap<String,String>();
    Map<String,String> c = a;In this case, there are only 2 objects.
    The first object has (at least) 2 references pointing to it.
    The second object has (at least) 1 reference pointing to it.
    (There may be more, if the HashMap library keeps
    references to these things, or if the HashMap object has
    some internal cyclic references...)
    If you're asking this, then it can't be done.
    It's an active research topic in universities
    and software research labs, called "alias analysis".
    Type it in google, and you'll see people are working hard
    and having little success so far.
    #2. Finding the number of instances created from a class.
    In this case, what you have to do is to add a counter to
    the constructor of the class. Every time an object is constructed,
    you increment the counter. Like this:
       class MyClass
           public static int counter = 0;
           public MyClass( )  { counter++; }
        // Then later in your program, you can do this:
        MyClass a = new MyClass();
        MyClass b = new MyClass();
        System.out.println(MyClass.counter); // It should show 2Note: you won't be able to do this to every class in the system.
    For every class you care about, you have to modify its constructor.
    Also: when an object is deleted, you won't always know it
    (and thus you won't always be able to decrement the counter).
    Finalizers cannot always work (read Joshua Bloch's
    "Effective Java" book if you don't believe me), but basically
    (1) finalizers will not always be called, and
    (2) finalizers can sometimes cause objects to not be deleted,
    and thus the JVM will run out of memory and crash

  • How to find the number of references to an object in a big application

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please don't post the same question multiple times.
    I've answered your question in the other thread here:
    http://forum.java.sun.com/thread.jspa?messageID=4312939

  • How to find the Data Type of a column

    Dear All,
    How to find the Data Type of a Column dynamically in oracle Form.
    Thanks and Regards,
    Fazil
    Edited by: user11334489 on Aug 25, 2012 9:06 PM

    hi,
    you can use get_item_property built-in
    eg:
    declare
       l_item VARCHAR2(10);
    begin
       l_item := Get_Item_Property('item_name',DATATYPE);
    end;

Maybe you are looking for

  • Excise Tab in GR for PO without material master

    Hi all, while creating GR for PO without material master, when we tick Item OK, excise tab is appearing. SO user has to select No excise Entry from Excise header tab, which user dont want to do as its not having any excise duy. So can anyone tell me

  • Problem to send text file to mail from ALV report

    Hi Friends, I have a problem in my ALV report with text file.  As per the requirment, when we execute the program then text attachment should go to the particual email. When i am using file type as XLS i am getting attachment with all 4 recoreds( inp

  • Can I plug my I pad directly into the Time Capsule to back it up?

    I Need to back up my I pad which is now full.  It has over 2500 photos that I need to store else where and have a new time capsule. I am not very tech savvy!!!!! 

  • When to call a BAPI inputexecute method from webdynpro-java?

    Hello... I'm a little concerned about a situation I'm having. The thing is that I'm trying to use the Bapi_Qualiprof_Change bapi with some test and hard coded data for a future application. It works fine if I fill the input profile_add table in the i

  • Unable to disable plugins

    I was using mobile broadband to connect to the Internet. Because it was prepaid and video was what ate up the most MBs I disabled all the plug-ins such as flash player, realplayer etc...that allowed video to run on webpages. This worked just fine and