How showing all function/procedure

- How showing all function/procedure headers parameter with type and
return type in Pl/sql .
- How to calculate the number of days to this year 1800 using sql-
statment without using pl/sql

DECLARE
STR VARCHAR2(2000);
STR1 VARCHAR2(100);
BEGIN
FOR I IN (select OBJECT_NAME,OBJECT_TYPE from user_objects where object_type in ('PROCEDURE','FUNCTION'))
LOOP
STR:=I.OBJECT_TYPE ||' '||I.OBJECT_NAME||'(';
FOR J IN (SELECT T.OBJECT_TYPE OBJECT_TYPE,U.object_name object_name, U.sequence sequence,u.in_out in_out,
U.argument_name argument_name, U.data_type data_type
FROM user_arguments U,
(select OBJECT_NAME,OBJECT_TYPE from user_objects where object_type in ('PROCEDURE','FUNCTION')) T
WHERE U.OBJECT_NAME=T.OBJECT_NAME AND U.OBJECT_NAME=I.OBJECT_NAME
ORDER BY U.object_name, U.sequence)
LOOP
IF J.ARGUMENT_NAME IS NULL THEN
STR1:=' RETURN '||J.DATA_TYPE||' '||J.IN_OUT;
ELSE
STR:=STR||J.ARGUMENT_NAME||' '||J.DATA_TYPE||' '||J.IN_OUT||',';
END IF;
END LOOP;
STR:=RTRIM(STR,',')||')'||STR1;
DBMS_OUTPUT.PUT_LINE(STR);
END LOOP;
END;
REGARDS
SUNIL

Similar Messages

  • How can I compile all functions, procedures and packages with a script?

    I need to compile all functions, procedures and packages of 5 schemas (users) with a script.
    How can I do it?
    Thanks!

    you can create a script to select all invalid objects in those schemas Since Oracle 8 introduced NDS this approach has struck me as a trifle old fashioned. It's much simpler to loop round the query in PL/SQL and use EXECUTE IMMEDIATE to fire off the DDL statements. No scripts, no muss, no fuss.
    Having said that, the problem with this approach and also with using DBMS_UTILITY.COMPILE_SCHEMA is that they do not compile all the invalid objects in dependency order. This may result in programs being invalidated by the subsequent compilation of dependencies. This is due to the introduction of Java into the database.
    The UTLRP script is much better, because it (usually) avoids cyclic references. But you still may need to run it more than once.
    In general it is better to avoid sledgehammer recompilations (like DBMS_UTILITY.COMPILE_SCHEMA, which starts by invalidating all the objects). If we have twenty invalid objects, nineteen of which are dependencies of the twentieth, we actually only need to recompile the master object, as recompiling it will trigger the recompilation of all the others.
    Cheers, APC

  • How to improve function & procedure performence

    Hi,
    How to improve performence of function and procedure .
    When i have to use parallel_enable,deterministic features .
    thank you
    Edited by: 808542 on Dec 22, 2010 2:25 AM
    Edited by: 808542 on Dec 22, 2010 2:26 AM

    How to improve performence of function and procedure .Start with tracing the session that executes the functions/procedures and tkprof the trc. file (with wait events).
    The tkprof output will give you pointers where you could make some improvement.
    You can find many examples on http://asktom.oracle.com, do a search on 'tuning'
    For example:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6904032233295
    If you have no clue what all this means then ask your DBA to help you.
    See also the Performance Tuning Guide @ http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/toc.htm

  • How to use functions/procedures like wwv_flow_sw_api

    Hello,
    I want to use functions/procedures like wwv_flow_sw_api.check_priv(:P4_SCHEMA) in a process, but I get the error "identifier wwv_flow_sw_api.check_priv(:P4_SCHEMA); must be declared".
    How can I access these functions?
    Thank you,
    Kirsten

    Hi Jari,
    my problem is, that I need to replicate the exact feature of Query Builder page in my
    application (see thread Re: How to create Query Builder page in application
    So I imported the page 1002 and tried to make it working.
    Do you know any solution?
    Than you,
    Kirsten

  • How  group by function/procedure used in function

    i want to capture information in different table which extract by select statement like(select trans_date from bankAccount group by cust_id).

    CTAS - Create Table As Select.
    Example:
    CREATE TABLE my_results
    NOLOGGING AS
    SELECT
      trans_date
    FROM bankAccount
    GROUP BY
      cust_idRefer to the [url http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm]Oracle® Database SQL Reference for details.

  • Exposé 'show all' keeps freezing my machine!

    hi all,
    been having an issue with exposé the last several days. about one out of every 15 times i use the 'show all' function, my computer completely freezes. i cant get to the force quit screen, and have to power off the computer and restart.
    the freeze seems to happen about halfway through the 'show all' process.
    anyone have ANY idea why this might be happening? its driving me nuts, and ive lost a ton of work this week because of it. ive already run disk utility and onyx, but the problem remains...
    thanks,
    mike

    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.

  • How to show all records by default on search result page?

    Hi
    I am trying to make a search page that would execute the search in the database based on one or more field constraints.
    (Using MySQL,PHP)
    I have  2 columns in the database "vm_ip" (primary key) <IP address>, "Operating_System" <Any, Windows, Solaris, AIX>
    need to search vm_ip based on other two fields.
    PROBLEM: Need to show all the record when I select "Any" in the Operating_System  drop down menu.
    <p>Operating System:
        <select name="os_select" id="os_select">
        <?php
    $os_count=1;
    foreach($os_type as $value) //(os_type is array with possible values of OS)
    echo "<option value=".$os_count.">".$value."</option>";
        $os_count++;
    ?>
          <option value=" " selected="selected">Any</option>
        </select>
      </p>
    this code POSts  NULL value to the search page.
    Below code is of recordset on  search page
    $varOS_virtual = "Operating_System"; // recordset variable set to same as column name (default value)
    if (isset($_POST['os_select'])) //this should not be true
      $varOS_virtual = $_POST['os_select'];
    mysql_select_db($database_xyz_db, $xyz_db);
    $query_virtual = sprintf("SELECT table.VM_IP FROM table
    WHERE table.Operating_System=%s", GetSQLValueString($varOS_virtual, "int"));
    $virtual = mysql_query($query_virtual, $xyz_db) or die(mysql_error());
    $row_virtual = mysql_fetch_assoc($virtual);
    $totalRows_virtual = mysql_num_rows($virtual);
    I expected the 'os_select' field to be null and default value of Operating_System to be "Operating_System" so that the Query shows all records.
    But instead the value being passed in the Query is "0". and no records are shown.
    What can I do to show all records?
    As probably obvious I am new to php/MySQL so all the help is most welcomed .
    Thanks

    Hi
    Thanks for the prompt reply but this does not solve my problem.
    First thing I appologise for giving you incorrect info. Actually I have many more constraints on the search apart from OS.
    Didn't think I would get single constraint specific ans.
    Here is what all i tried and problems I faced:
    1. I cannot use seperate queries cause I have around 7-8 other constraints on the search.
    2. I cannot play around with the Record set code. For some reason even if I mess with it a little bit Dreamweaver stops recognising the recordset. for eg i tried the below code:
    $query_virtual = sprintf("SELECT table.VM_IP FROM table WHERE
    table.Operating_System=%s ,($_POST['os_select']=="")? TRUE:GetSQLValueString($varOS_virtual, "int"));
    this ran well for the first time, and then the record set was screwed up. kept on asking me to "Discover" the links, which it couldn't do.
    3.  take a look at this code:
    $varOS_virtual = "Operating_System";
    if (isset($_POST['os_select'])) {
      $varOS_virtual = $_POST['os_select'];
    $varState_virtual = "State";               //second constraint
    if (isset($_POST['state_select'])) {
      $varState_virtual = $_POST['state_select'];
    mysql_select_db($database_xyz, $xyz);
    $query_virtual = sprintf("SELECT table.VM_IP FROM table AND table.Operating_System=%s AND State=%s",
    GetSQLValueString($varOS_virtual, "int"),GetSQLValueString($varState_virtual, "int"));
    $virtual = mysql_query($query_virtual, $xyz) or die(mysql_error());
    $row_virtual = mysql_fetch_assoc($virtual);
    $totalRows_virtual = mysql_num_rows($virtual);
    here on passing NULL value for "Any"  GetSQLValueString($varOS_virtual, "int") functions returns NULL and though the Default value of
    varOS is set to 'Operating_System" query takes NULL value only which when executed shows no records.
    My problem majorly revolves around how to put something like "WHERE Operating_System= Operating_System" OR  "WHERE Operating_System= TRUE" in the query, when passed through variable they are sent as Strings or NULL.
    Thats why WHERE 1=1 also doesnt work, because it has "WHERE Operating_System= NULL" in AND.
    Logically when NULL is passed default value of variable should comeinto picture, but tha isnt happening.
    Thanks again for answering. hope I was able to explain my problem.

  • Function module u0091GET_PRINT_PARAMETERSu0092 Not showing all columns

    Hello all,
    I am using function module ‘GET_PRINT_PARAMETERS’
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          DESTINATION    = LOC_DEST
          COPIES         = WF_COPIES
          LIST_NAME      = WF_LISTNAME
          LIST_TEXT      = WF_LISTTEXT
          IMMEDIATELY    = ' '
          RELEASE        = ' '
          NEW_LIST_ID    = 'X'
          EXPIRATION     = WF_DAYS
          LINE_SIZE      = 132
          LINE_COUNT     = 65
          LAYOUT         = 'X_65_132'
          SAP_COVER_PAGE = 'X'
          RECEIVER       = 'SAP*'
          DEPARTMENT     = ''
          NO_DIALOG      = 'X'
        IMPORTING
          OUT_PARAMETERS = WF_PARAMS
          VALID          = WF_VALID.
    NEW-PAGE PRINT ON PARAMETERS WF_PARAMS NO DIALOG.
        PERFORM WRITE_PDF_SUMMARY USING P_VALID P_COND P_ZMGC P_ZOGC P_PDF.
        NEW-PAGE PRINT OFF.
    But in my report there are 10 columns and in download file it’s showing only 6 columns .If I increase that size to X_65_200 Then it shows all columns But it’s not readable. Please tell me how can I use that fix size X_65_132 & it will show all columns .
    Message was edited by:
            megha waykar

    You r right,But that program is already developed in following sequence
    *==>  1. Create Virtual Spool
                using FUNCTION 'GET_PRINT_PARAMETERS'
    *==>  2. Write Report to Virtual Spool. Use NEW-PAGE PRINT ON option.
                NEW-PAGE PRINT ON PARAMETERS WF_PARAMS NO DIALOG.
                PERFORM WRITE_PDF_SUMMARY USING P_VALID            
                NEW-PAGE PRINT OFF.
    *===> 3. Prepare Path and set spool number.
    *===> 4. Convert List to PDF format.
                 Use function 'CONVERT_ABAPSPOOLJOB_2_PDF'
    *==> 5. download PDF file
                CALL FUNCTION 'GUI_DOWNLOAD'.
    and it's not showing readable download file.
    I don't have to change whole coding. I just want to increase that font.

  • How to show all items in the reading list? I think this option has been removed in Safari Version 7.0.2

    How to show all items in the reading list? I think this option has been removed in Safari Version 7.0.2

    Thanks. That solved it. I had my doubts since I wasn't concerned about my lost bookmarks. I was concerned about the broken functionality. In any event, restoring from a backup solved both the functionality and the lost bookmarks. I appreciate the response!

  • How to Create a Procedure/Function to Return more than one value

    How I can write a function/Procedure to which one value is passed and it will return nine values. How I can use these values

    Syed,
    I would use PL_SQL table versus a VARRAY for this purpose as you will have an advantage of joining PL_SQL table if you want to in your SQL statements in the procedure.
    1. At the SQL prompt, create a type using,
       create or replace type myTable as table of VARCHAR2(100);
    2. Pass the table to your procedure as IN OUT parameter,
    Create or replace procedure
    myProc(pvar1 IN Number, passingArray IN OUT myTable) AS
    Begin
        --Fill the array with your logic
        for i in 1..9
        loop
            passingArray.extend;
            passingArray(passingArray.count) := 'what ever';
        end loop; 
    End;
    3. From your Main prog, you call  Myproc
       --declare a variable for type first
       passingArray myTable := myTable();
       begin
       myProc(10, passingArray());
       --At this point, You would be able to Join the PL_SQL table
       --which gives you the power of using SQL with PL_SQL tables
       end; -- end of main program
    4. All done!I have not shown how to use PL_SQL tables in SELECT statements, as that is not the subject here.
    At the end of the story, I would say, if you know the number of arguments that you are going to pass to a procedure, Simply use "that many" IN OUT parameters to finish your task(9 in your case). Although the proc call looks large with this, it is much simpler. The above approach is VERY helpful if YOU DO NOT KNOW THE NUMBER OF ARGUMENTS that you are sending AND receiving From a procedure.
    Thx,
    SriDHAR

  • How to call plsql procedure or function and getting back the string?

    Hi Everyone,
    i am using Jdev 11.1.1.5.0.
    i have a requirement to call plsql procedure or function from my backing bean java file and get back the returned value from the procedure or function.
    what piece of simple code i need to write in my backing bean?
    please suggest.
    Thanks.

    As always you write the method to call he pl/sql in the application module, expose this method to the client (so you see it in the datacontroll) then create a operation binding to the method and call this operation from the bean. The result you get by operation.getResult();
    You should never call pl/sql from the bean directly!
    The doc shows how to call the procedure from an application module: http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcadvgen.htm#sm0297
    Timo

  • Package Body in the tree doesn't show all procedures

    I am using Sql Developer 1.0.0.14.67 on Win XP Professional,
    DB servers Oracle 9i on both Linux Red HAt and Win XP Professional
    I have troubles with one of packages - in the tree under Package Body SQL Developer doesn't show all procedures of this package body.
    On the right panel all package body source is shown, but in the tree under Package Body it shows names of only procedures up to certain line in the source code - up to line where first Private (not included in Package Spec) procedure code starts.
    BUT, there are more Public procedures in package body below this Private procedure - and all of procedures below first private are not included in the tree under Package Body

    I find this quite annoying. I cannot use the navigation panel on the left to find the location of all functions and procedures in the package body. The 'missing' procedures are listed under the package spec, and double clicking on them takes me to the spec and not the body.
    I'm running v1.2.1.32.13. Is this a know issue and is there a fix planned?

  • How can I get list of columns used of specific table in all stored procedure?

    How can I get used column list of a specific table in among all stored procedure?
    Suppose that,
    I have a table(VendorMaster) which has 100 columns just I want to know how many columns used in among all stored procedure.

    We have solved by below query...
    IF OBJECT_ID('tempdb.dbo.#SPDependencyDetails') IS NOT NULL
    DROP TABLE #SPDependencyDetails
    CREATE TABLE #SPDependencyDetails
     Or_Object_Database NVARCHAR(128)
    ,Or_Object_Name NVARCHAR(128)
    ,Ref_Database_Name NVARCHAR(128)
    ,Ref_Schema_Name NVARCHAR(128)
    ,Ref_Object_Name NVARCHAR(128)
    ,Ref_Column_Name NVARCHAR(128)
    ,Is_Selected BIT
    ,Is_Updated BIT
    ,Is_Select_All BIT
    ,Is_All_Columns_Found BIT
    DECLARE @database_name VARCHAR(100)
    DECLARE database_cursor CURSOR
    FOR
    SELECT name
        FROM sys.databases
        WHERE database_id =8
    OPEN database_cursor
    FETCH NEXT FROM database_cursor
    INTO @database_name
    WHILE @@FETCH_STATUS = 0 --Outer Loop begin
    BEGIN
        DECLARE  @WholeLotofSQL NVARCHAR(MAX) =       '
        DECLARE @object_name VARCHAR(150)
        ,@sqlstatement NVARCHAR(2500)
        DECLARE object_cursor CURSOR --Inner cursor, iterates list of objects that match type
        FOR
            SELECT name
                FROM '+@database_name+'.sys.objects AS o
                WHERE o.type = ''P'' --Change Object type to find dependencies of Functions, Views and etc.
                ORDER BY 1    
        OPEN object_cursor
        FETCH NEXT FROM object_cursor INTO @object_name
        WHILE @@FETCH_STATUS = 0  --Inner Loop Begin
            BEGIN
                SET @sqlstatement = ''USE '+@database_name+';
                                    INSERT INTO #SPDependencyDetails
                                    SELECT DB_NAME() AS Or_Object_Database
                                            ,'''''' + @object_name + '''''' AS Or_Object_Name
                                            ,CASE WHEN referenced_database_name IS NULL THEN DB_NAME()
                                                    ELSE referenced_database_name
                                            END AS Ref_Database_Name
                                            ,referenced_schema_name AS Ref_Schema_Name
                                            ,referenced_entity_name AS Ref_Object_Name
                                            ,referenced_minor_name AS Ref_Column_Name
                                            ,is_selected
                                            ,is_updated
                                            ,is_select_all
                                            ,is_all_columns_found
                                        FROM sys.dm_sql_referenced_entities(''''dbo.'' + @object_name + '''''', ''''OBJECT'''');''
                EXEC sys.sp_executesql @sqlstatement
                FETCH NEXT FROM object_cursor INTO @object_name
            END      
        CLOSE object_cursor
        DEALLOCATE object_cursor'
        EXEC sys.sp_executesql @WholeLotofSQL
        FETCH NEXT FROM database_cursor INTO @database_name
    END
    CLOSE database_cursor;
    DEALLOCATE database_cursor;
    SELECT Or_Object_Database as 'Database'
    ,Or_Object_Name as 'Procedure'
    ,Ref_Object_Name as 'Table'
    ,Ref_Column_Name as 'Column'
    FROM #SPDependencyDetails

  • Getting all Functions and Procedures using DBA_ARGUMENTS

    Hi All
    I am wanting to find out all functions and procedures that are within each of my packages and am using the following SQL to do this.
    SELECT DISTINCT A.OBJECT_NAME, A.PACKAGE_NAME,
    DECODE(POSITION,0,'FUNCTION','PROCEDURE')
    FROM DBA_ARGUMENTS A
    WHERE OWNER = 'NB'
    I have discovered however that if a procedure has been overloaded with function will appear twice: as procedure and as a function
    I was wondering if there was any workaround for this as I would only like a function to be displayed once?
    Kind Regards
    Mark

    There is an 'OVERLOAD' column which can be used to show only specific overloads (e.g. first).
    Determining which overload should be displayed in any given case may require some more thought.

  • I have lost all functions of the keyboard volume controls. i cannot find any controls for this. how

    My HP Pavillion has lost all functions of the keyboard volume controls. Icannot find any controls for this. How do I go about getting
    this reset?

    Hi,
    Try using Recovery Manager to reinstall your Audio Driver ( this will probably be IDT, but could be Realtek or Conexant ) - the procedure for using recovery manager to reinstall Software and Drivers is detailed in the relevant document on the link below.
    Recovery Manager - Windows 7
    Recovery Manager - Windows Vista
    After the reinstallation has completed, restart the notebook.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

Maybe you are looking for

  • Is there any way to automatically add an attachment to a message in Mail?

    Hi, I have to responsd to a lot of emails with basically the same response. I use a TextExpander snippet for the body of these messages. However, I usually need to attach a PDF file as well. Is there anyway to automate attaching a PDF attachement to

  • Update in JDBC-Adapter (Send)

    Hallo, I´m trying to execute a Update in the JDBC-Adapter (Sender). When a Select-Statement results in exactly one entry back from the data-base I wont to Update this entry. How refrencing to the enty (for example by an primary key)? I found only doc

  • Delete Relationships via API

    Can anyone tell me the correct method for deleting relationships within the repository using the API? It seems to me that deleting one end of a relationship would null-out the OTHER_RELATIONSHIP_END_REF value on the other end of the relationship and

  • HT201269 how do i move everything from my ipod touch to my new iphone4?

    how do i move my pictures from my ipod touch on to my new iphone4?

  • ERR-1082 Error in executing authorization scheme code.

    Hi All, i have a different problem in apex.... I am using below function to authenticate the apex users after SSO login. I have created authentication schemes for admin and users separately depending on that users will have access to the specific tab