How to find type of PL/SQL in package

Hi All,
I want to find all procedures/ Functions in package specification along with their type.
Eg. if there is procedure p1 and function f1 in package pk1 i want a query that will return
Package Proc/Function_name Type
pk1 p1 procedure
pk1 f1 function
from user procedures i can get only procedure/funtion name bur not its type.

Hi,
Yes, I think metzguar got one.
Package dropped.
SQL> create package p1
as
   function f
      return number;
   procedure p;
   function f(x number)
      return number;
   procedure p(x number);
end;
Package created.
SQL> select package_name, object_name, case min(position)
                                       when 0 then 'FUNCTION'
                                       when 1 then 'PROCEDURE'
                                    end
                                       method_type
    from user_arguments
   where package_name = 'P1'
     and nvl(overload, 1) = 1
group by package_name, object_name
PACKAGE_NAME                   OBJECT_NAME                    METHOD_TY
P1                             P                              PROCEDURE
P1                             F                              FUNCTION
2 rows selected.Regards
Peter

Similar Messages

  • How to find leap year in sql query

    How to find leap year in sql query

    Select
    CASE
      WHEN result = 0 THEN 'Leap_Year'
      WHEN result <> 0 THEN 'Not_A_Leap_Year'
    END
    From (Select mod((EXTRACT(YEAR FROM DATE '2013-08-24')), 4) result FROM DUAL);

  • How to find session information in sql plus

    Can someone please tell me how to find session information in sql plus? I specifically want to know my privileges for the current session. Thanks in advance.

    SELECT * FROM session_privs;
    SELECT * FROM session_roles;

  • How to find type of a table....

    Hi,
    There is a name that is either a normal table or external table or queue table. How to find out table type. Type column of user_objects shows type as Table for all the three.
    Regards,
    Sanjeev

    Sanjeev according to me, all the three are in different dictionary tables and not in one user_tables. user_tables hold information only for normal tables.
    SQL> desc USER_EXTERNAL_TABLES
    Name                                      Null?    Type
    TABLE_NAME                                NOT NULL VARCHAR2(30)
    TYPE_OWNER                                         CHAR(3)
    TYPE_NAME                                 NOT NULL VARCHAR2(30)
    DEFAULT_DIRECTORY_OWNER                            CHAR(3)
    DEFAULT_DIRECTORY_NAME                    NOT NULL VARCHAR2(30)
    REJECT_LIMIT                                       VARCHAR2(40)
    ACCESS_TYPE                                        VARCHAR2(7)
    ACCESS_PARAMETERS                                  VARCHAR2(4000)
    SQL>  desc USER_queue_tables
    Name                                      Null?    Type
    QUEUE_TABLE                                        VARCHAR2(30)
    TYPE                                               VARCHAR2(7)
    OBJECT_TYPE                                        VARCHAR2(61)
    SORT_ORDER                                         VARCHAR2(22)
    RECIPIENTS                                         VARCHAR2(8)
    MESSAGE_GROUPING                                   VARCHAR2(13)
    COMPATIBLE                                         VARCHAR2(5)
    PRIMARY_INSTANCE                                   NUMBER
    SECONDARY_INSTANCE                                 NUMBER
    OWNER_INSTANCE                                     NUMBER
    USER_COMMENT                                       VARCHAR2(50)
    SECURE                                             VARCHAR2(3)

  • How to find where the below sql is used in database

    Hi all,
    I am tring to find the below SQL in our data base where it is used?
    I had done the checking in all reports manually, But have no luck.
    But i am sure that the below sql is in our data base and having some issue on it.
    Can any one please let me know how to find where the below query is used in our database? I mean in packages/ triggers/ procedures or any where in our database
    Please find the query
    select count(sh.shipment_gid) from SHIPMENT sh, SHIPMENT_TYPE stp, LOCATION ld where (sh.shipment_gid in (select sstop.shipment_gid from SHIPMENT_STOP sstop where (sstop.appointment_delivery > trunc(TO_DATE(:1, :2), :3)) and (sstop.appointment_delivery is not null))) and (sh.is_to_be_held=:"SYS_B_0") and (sh.domain_name=:4) and (sh.insurance_policy_number like :"SYS_B_1") and (sh.perspective=:"SYS_B_2") and (sh.shipment_type_gid=stp.shipment_type_gid) and (sh.dest_location_gid=ld.location_gid(+)) and (stp.shipment_type_xid!=:5) order by ld.location_name, sh.start_time
    Regards,
    Dpk

    There is video demonstration how to import from data dictionary.
    After import you can select from the main menu: View->DDL File Editor menu item to open the DDL dialog and then click on "Generate" button on the dialog. When the DDL is generated you can search in it using "Find" button.
    Ivan

  • How to find out the failed sql command and its data from DEFERROR

    Hi,
    has anybody a procedure or some other possibilities to read the content of column USER_DATA of the advanced replication view DEFERROR in order to find out the failed sql command and its column values?
    Thanks in advance.

    Hi Vishwa,
                 The control would be something like this for navigation in Get_p_xxx method u mention as link and u mention a event name which gets triggered on the click of this hyperlink. So your GET_P_XXX method would have the following code:
    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
        WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
          rv_value = 'EXAMPLE'.
    Now you have to create a method as EH_ONEXAMPLE at your IMPL class and within which you would give an outbound plug method. Within the outbound plug the target data would be filled in the collection and window outbound plug would be triggered.
    This is a huge topic and  i have just mentioned you basic things.
    Regards,
    Bharathy.

  • How to find out who installed SQL Server in Big orgnization?

    Hi all,,,
    I want to find out who installed SQL server in their computers/servers. The internet is open and it's easy to install SQL server EXPRESS. Iam not looking for the command which will results computers in my vlan only. Iam looking for a query to result out
    all SQL installed with different Vlan within the organization.
    Anyway to find them out?!  Thanks.

    No need to know WHO install it but is it possible to know the Host name that SQL installed in?!
    You asked for "who", not for "where".
    You can use MS MAP =
    Microsoft Assessment and Planning Toolkit : "Software Usage Tracker Feature Overview ....
    SQL Server" to get reports, which software is running on which machine.
    Or you can use this PowerShell Script
    Create Inventory of SQL Server in Network as Html
    For both you need permissions to fetch the required information from all machines, of course.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to find CR Request Number inside a package

    Hi Folks,
    how to find the CR Request Number list present inside one package.
    Reg,
    Hariharan

    Hi ,
    i had gone through the Transaction se03 Search for Object in Request/Task, in the selection screen no option for Package can you just breaf about the Selection Screen Step.
    Reg,
    Hari.

  • How to find out which job is calling package

    Respected sir,
    How to find out which job is calling my package. Please help me regarding this.
    Regards,
    user570124

    Please read about [url http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#i997163]DBMS_UTILITY.FORMAT_CALL_STACK in the manual.
    or [url http://asktom.oracle.com/tkyte/who_called_me/index.html]this routine from Tom Kyte may be what you are looking for.
    Regards,
    Rob.

  • How to find duplicate row in sql query?

    Hi All,
    Please solve my query, find duplicate row and how to count its. your suggestion would be greatly appreciated.

    You can use group by and having.
    SQL> WITH t
      2       AS (SELECT       LEVEL id
      3                 FROM   DUAL
      4           CONNECT BY   LEVEL <= 5
      5           UNION ALL
      6           SELECT       LEVEL + 2
      7                 FROM   DUAL
      8           CONNECT BY   LEVEL <= 3)
      9  SELECT   *
    10    FROM   t;
            ID
             1
             2
             3
             4
             5
             3
             4
             5
    8 rows selected.
    SQL> WITH t
      2       AS (SELECT       LEVEL id
      3                 FROM   DUAL
      4           CONNECT BY   LEVEL <= 5
      5           UNION ALL
      6           SELECT       LEVEL + 2
      7                 FROM   DUAL
      8           CONNECT BY   LEVEL <= 3)
      9  SELECT     id, COUNT (*)
    10      FROM   t
    11  GROUP BY   id
    12    HAVING   COUNT (*) > 1;
            ID   COUNT(*)
             3          2
             4          2
             5          2
    SQL>

  • How to find who has changed SQL Server Agent 'Job History' settings.

    Hi all,
    I was searching from couple of days to know is there a way to find out who has changed the SQl agent property settings.
    Like if someone unchecks the SQL Agent History settings how i can find who has done that change?
    I searched for trace flags but there is nothing related to it, i searched for system tables and views of msdb but nothing which can give this information, even didn't find any audit setting that can monitor these activities.
    My sql version is SQL Server 2008. Please throw your ides on how to track the sql agent history setting changes!!!
    Thanks In Advance!!!!
    VVinayPrasad

    Hi,
    You might be able to AUDIT the execute on that SP but its not giving exactly what has been changed... i guess you are getting what i am looking for...
    whatever the property might be changed it only shows the sp name thats it.... but not the exact sql statement executed on background
    VVinayPrasad
    First of all: It's not about me, it's about you. And it's not a might, its a given fact. I
    tested it for you.
    Second: your question was:
    >>I was searching from couple of days to know is there a way to find out
    who has changed the SQl agent property settings.
    >>Like if someone unchecks the SQL Agent History settings how i can find who has done that change?
    So please first clear up, what you really need.
    Third: instead of Auditing I already gave the advise to use Tracing (be it SQLTrace or Extended Events). Both will give you the exact statement. SQLTrace may be easier on SQL2008
    Please try all of the provided first before doing guesswork.
    Andreas Wolter (Blog |
    Twitter)
    MCM - Microsoft Certified Master SQL Server 2008
    MCSM - Microsoft Certified Solutions Master Data Platform, SQL Server 2012
    www.andreas-wolter.com |
    www.SarpedonQualityLab.com

  • How to find sid,serial# for sql in v$sqlarea

    Hi,
    10gR2
    in order to dig down the session which is running particular sql
    say querying v$sqlarea and getting sql_id
    now how to map it to v$session

    thanks for the reponse
    Join v$sqlarea's address with v$session's sql_address.
    does this always mapped, even if sql has completed execution
    say i have made a session of user scott
    and ran this statement
    ===================================
    SQL> create table my_obj as select * from obj;
    Table created.
    now i jhave another session of sys to find session details
    ============================================
    SQL> select SQL_ID,EXECUTIONS,DISK_READS,BUFFER_GETS,ADDRESS,CPU_TIME,PROGRAM_ID,SQL_TEXT
    FROM GV$SQLAREA WHERE SQL_TEXT LIKE ' 2 %MY_OBJ%';
    SQL_ID     EXECUTIONS DISK_READS BUFFER_GETS ADDRESS      CPU_TIME
    PROGRAM_ID
    SQL_TEXT
    4hshv4csmh7d8     1     0     14 000000007ECDF248 2899
         0
    select SQL_ID,EXECUTIONS,DISK_READS,BUFFER_GETS,ADDRESS,CPU_TIME,PROGRAM_ID,SQL_
    TEXT FROM GV$SQLAREA WHERE SQL_TEXT LIKE '%MY_OBJ%'
    SQL> select sql_address ,sid,serial#,username from v$session where sql_address='000000007ECDF248';
    no rows selected
    SQL> select sql_id ,prev_sql_id ,sql_address ,sid,serial#,username from v$session where sql_id='4hshv4csmh7d8';
    no rows selected
    SQL> select sql_id ,prev_sql_id ,sql_address ,sid,serial#,username from v$session where prev_sql_id='4hshv4csmh7d8';
    no rows selected
    please suggest
    another other view
    or there may be two cases of this
    case1 sql is running
    case 2 sql is completed

  • How to find out if a SQL is using a bind variable or not?

    In order to make a SQL use consistent execution plan, I want to create a profile for a SQL. But I need to know if a SQL is using bind variable or not to create a profile for all the same SQLs except the literal value. How can I do that?
    Thanks in advance

    You can tell if an SQL statement uses a bind variable by looking at the SQL statement.
    If you look in the program that submits the SQL statement you can see how it constructs, prepares, and executes the statement.
    If you are just looking at the SQL in the shared pool then depending on how the statement is written and the setting of database parameters like cursor sharing then it can be more difficult but if you see a constant (actual value) that is a constant. A bind variable would appear as a name in the where clause where that name does not exist any of the tables referenced in the query. Note it is technically possible to create pl/sql variables with the same name as columns in the query but that is poor coding and leads to issues.
    Note - To Oracle two versions of the otherwise same query where one has a constant and the other has a bind variable are not the same query and often produce different plans. This is a common error made by developers new to Oracle when using explain plan. To explain a query that uses bind variables place a ":" in front of the variable name in the SQL submitted to explain plan.
    HTH -- Mark D Powell --

  • HOW TO FIND AND CORRECT THE SQL QUERY ERRORS ????

    Sometimes I get the errors while executing the sql queries.
    I just wanted to know about the various ways by which I can find the sql query errors .
    Any suggestions will be deeply appreciated.

    If you get the an error from SSMS and you can't comprehend it, you can google the error message and google would always lead you to the correction. Or you can post the error in this forum, people
    here are always kind and ready to help :).
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to find out which PL/SQL Proc is Compiled with Debug?

    Hi,
    is there any View where i can see, which PL/SQL Proc is compiled with the debug flag?
    Thanks
    Marco
    Message was edited by:
    mpatzwah

    Alternatively:
    select name, plsql_debug from sys.all_plsql_object_settings

Maybe you are looking for

  • PLEASE HELP!!  Trying to install an HP Printer

    I am trying to install my HP Deskjet 3940 to my Mac Mini. When I put in the disk provided by HP, and double click a message comes up saying: "An error occured while reading the installer data. This installer appears to be damaged". So I went to HP's

  • How to get rid of mutiple events showing in calenders for the same event

    How do you get rid of mutiple events that show up in your calender of the same event. It doesn't matter what kind of event it is whether personel or yearly holiday it shows up mutiple times in the month view, list view. I've gone through and deleted

  • JDBC Driver for DB2

    Hello. I want to connecto to a remote DB2 database by the way of JDBC. The client is a Windows2000 Machine, the server machine is a AS/400. What JDBC drivers do I need in my windows client to connect to a DB2/400 Machine? I understand that only need

  • Linking 2 PDFs in the same web page

    I'm trying to find the coding to link 2 or more PDFs into one embeded Adobe Reader in a web page.  Click one and it loads in the embed reader below.  Click the other and it loads that one instead.  I'm sure it exists somewhere, but I haven't had any

  • Browsing in AppleTV by Composer sorts by Name first

    and not by Album and then by Name as it does in iTunes on my iMac. This should be a simple thing to fix.