an overload of mechanism in the package

Hello

I know that one of the benefits of the use of packages is on loading mechanism, which is the same name with a different signature (number of parameters).

But my question what is the use of it.

Think about some of the functions - standard "to_char", for example. It is very useful 'to_char' is too large so that it can take a date or a string, or a time stamp, apply a model of different format and produce a useful string that is appropriate for the type of input data. From time to time, you'll want to do something similar in the code that you develop in this case, you'll want to overload a procedure within a package.

Justin

Tags: Database

Similar Questions

  • Wait for the mechanism in the parallel execution of packages

    Dear all,

    I submit two packets in parallel as below, which works very well.

    I present this in a shell script which is registered as a front end program.

    Front end program completed in a second, while the data are not visible in the tables, the data is visible only when the execution of the package completed.

    Please can you suggest a mechanism so that I can make the plsql block in shell script to wait for both the delivery of completed packages.

    #!/bin/sh                                                                                 |
    . $CUST_TOP/bin/CUST_ID_CM.env
    export INFA_USER=$INFA_USER
    export userpass=`(echo $1 | cut -f2 -d'"' | cut -d '"' -f3)`
    ploadtype=$5 
    pyear=$7
    #####################################################################
    if [ "$ploadtype" = "Restatement" ]; then
    sqlplus -s $userpass <<EOF
    set heading off feedback off verify off serveroutput on
    spool /usr/tmp/tmp_tph_load.txt
    DECLARE
      l_cnt NUMBER;
    BEGIN
      DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_RESTATEMENTS',
                                job_type            => 'STORED_PROCEDURE',
                                job_action          => 'RESTATEMENTS_DATAFEED_PKG.INSERT_RESTATEMENTS_P',
                                number_of_arguments => 1,
                                enabled             => FALSE,
                                auto_drop           => TRUE);
      DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name          => 'YEARLY_RESTATEMENTS',
                                            argument_position => 1,
                                            argument_value    => '$7');
      DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS');
      DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_ACTUALS',
                                job_type            => 'STORED_PROCEDURE',
                                job_action          => 'ACTUALS_DATAFEED_PKG.INSERT_ACTUALS_P',
                                number_of_arguments => 1,
                                enabled             => FALSE,
                                auto_drop           => TRUE);
      DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name          => 'YEARLY_ACTUALS',
                                            argument_position => 1,
                                            argument_value    => '$7');
      DBMS_SCHEDULER.ENABLE('YEARLY_ACTUALS');
      LOOP
        SELECT COUNT(1)
          INTO l_cnt
          FROM DBA_SCHEDULER_RUNNING_JOBS
         WHERE UPPER(job_name) IN
               (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
        EXIT WHEN l_cnt < 1;
      END LOOP;
    END;
    /
    EOF
    #
    fi
    exit
    

    Your problem is the timing. You can perform the check at DBA_SCHEDULER_RUNNING_JOBS before the entry is actually in there.

    Here is an example. I just submitted a PLSQL_BLOCK waiting for 60 seconds.

    SQL> DECLARE
      2    l_cnt NUMBER;
      3  BEGIN
      4    dbms_output.put_line(systimestamp || ' - Started');
      5    DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_RESTATEMENTS',
      6                              job_type            => 'PLSQL_BLOCK',
      7                              job_action          => 'BEGIN DBMS_LOCK.SLEEP(60); END;',
      8                              enabled             => FALSE,
      9                              auto_drop           => TRUE);
     10    DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS');
     11
     12    LOOP
     13      SELECT COUNT(1) into l_cnt
     14        FROM DBA_SCHEDULER_RUNNING_JOBS
     15       WHERE UPPER(job_name) IN
     16             (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
     17
     18      EXIT WHEN l_cnt < 1;
     19      dbms_output.put_line(systimestamp || ' - Waiting');
     20      dbms_lock.sleep(10);
     21    END LOOP;
     22    dbms_output.put_line(systimestamp || ' - Completed');
     23  END;
     24  /
    04-DEC-14 02.32.00.075794000 AM -05:00 - Started
    04-DEC-14 02.32.00.121862000 AM -05:00 - Completed
    
    PL/SQL procedure successfully completed.
    

    Now it ends immediately. But you can see that the job is still running.

    SQL>     SELECT COUNT(1)
      2        FROM DBA_SCHEDULER_RUNNING_JOBS
      3       WHERE UPPER(job_name) IN
      4             (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
    
      COUNT(1)
    ----------
             1
    

    Now I make my code to wait 5 seconds before the audit

    SQL> DECLARE
      2    l_cnt NUMBER;
      3  BEGIN
      4    dbms_output.put_line(systimestamp || ' - Started');
      5    DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_RESTATEMENTS',
      6                              job_type            => 'PLSQL_BLOCK',
      7                              job_action          => 'BEGIN DBMS_LOCK.SLEEP(60); END;',
      8                              enabled             => FALSE,
      9                              auto_drop           => TRUE);
     10    DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS');
     11
     12    -- Wait for a wile before checking
     13    dbms_lock.sleep(5);
     14    LOOP
     15      SELECT COUNT(1) into l_cnt
     16        FROM DBA_SCHEDULER_RUNNING_JOBS
     17       WHERE UPPER(job_name) IN
     18             (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
     19
     20      EXIT WHEN l_cnt < 1;
     21      dbms_output.put_line(systimestamp || ' - Waiting');
     22      dbms_lock.sleep(10);
     23    END LOOP;
     24    dbms_output.put_line(systimestamp || ' - Completed');
     25  END;
     26  /
    04-DEC-14 02.33.09.294256000 AM -05:00 - Started
    04-DEC-14 02.33.14.347866000 AM -05:00 - Waiting
    04-DEC-14 02.33.24.369777000 AM -05:00 - Waiting
    04-DEC-14 02.33.34.389725000 AM -05:00 - Waiting
    04-DEC-14 02.33.44.410508000 AM -05:00 - Waiting
    04-DEC-14 02.33.54.430561000 AM -05:00 - Waiting
    04-DEC-14 02.34.04.450684000 AM -05:00 - Waiting
    04-DEC-14 02.34.14.462191000 AM -05:00 - Completed
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Now you can see the code entered in the loop and waited.

  • How to find the part creator problem of the code in the package?

    Hi gurus

    This question is just for my goal of learning, my question is that if I create a package that have 10 000 lines, includes several functions and procedures, but when I then run my stuck bundle / freeze on some specific code so how is it, I identify the specific part of the code. Thanks in advance

    Concerning

    Shu

    Hi Shu,

    What do you mean by the method of logging? is there a utility to do this?

    even if it's not 'connect' mechanism but the simplest solution is to instrument your code to package with the DBMS_APPLICATION_INFO package programs. For example SET_ACTION at the beginning of each subprogramme in the package. See http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_appinf.htm

    "Application developers can use the DBMS_APPLICATION_INFO package with Trace of Oracle and the SQL trace facility to the record names of execution modules or transactions in the database for use later when monitoring the performance of the different modules and debugging."

    Then, you can monitor for sid, serial # when running from v$ session http://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_3016.htm#REFRN30223

    MODULE VARCHAR2(48) Name of the module running in the game by calling the DBMS_APPLICATION_INFO.SET_MODULE procedure
    ACTION VARCHAR2(32) Name of the action being performed as defined by calling the DBMS_APPLICATION_INFO.SET_ACTION procedure
    CLIENT_INFO VARCHAR2(64) Information defined by the DBMS_APPLICATION_INFO.SET_CLIENT_INFO procedure

    and for sid and serial No.

    v$ session_wait https://docs.oracle.com/cd/B28359_01/server.111/b28320/dynviews_3023.htm

    and

    v$ session_longops http://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_3022.htm#REFRN30227

    and other license pack tuning requiring views

    Finally the answer to your question. If you do not have your own recorder there is for example LOG4PLSQL: logging of Oracle database tools (I've never used).

  • 30EA2 Alternative citing mechinism hides the content of the package 3.0.02

    In SQLDev 3.0EA2:

    Using the alternative quoting mechanism '[' q in a package body to quote a string more 97 causes the contents of the package to hide in the sketch and browser connection.
    create or replace
    package my_test as
      function f1 return varchar2;
      function f2 return varchar2;
      procedure p1;
    end my_test;
    /
    
    create or replace
    package body my_test as
    
      function f1 return varchar2 is
        l_txt varchar2(2000);
      begin
        l_txt := 'This function is hidden by f2';
        return l_txt;
      end;
    
      function f2 return varchar2 is
        l_txt varchar2(2000);
      begin
    --                       1         2         3         4         5         6         7         8         9
        l_txt := q'[12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678]';
        return l_txt;
      end;
      
      procedure p1 is
        l_txt varchar2(2000);
      begin
        l_txt := 'this procedure is hidden by f2';
      end;
    end my_test;
    /
    The above code compiles and runs correctly, but the second function of the package (f2) hides the contents of the package to view in the browser of the object and the viewer of contour. Change the string in double quotes, as he had the q '[' quoting convention reveals the spec of package in the views of navigator body. It seems that any set of braces is subject to this question {}, [], (), <>, however single character delimiters such as ~ as q'~ text ~' work very well.

    This problem can be validated and bugged?

    Thank you

    Sentinel

    It corrects a problem with this style of protection which very probably will fix yours too.

    Kind regards
    K.

  • Install the package for Firefox 30.0 on Sun Solaris 10 SPARC?

    Looking for the latest Firefox 30 Sun Solaris 10 SPARC package. It appears he either not yet displayed or development of Firefox on Sun Solaris has ceased.

    http://FTP.Mozilla.org/pub/mozilla.org/Firefox/releases/latest/contrib/
    http://FTP.Mozilla.org/pub/mozilla.org/Firefox/releases/latest/contrib-localized/

    http://FTP.Mozilla.org/pub/mozilla.org/Firefox/releases/30.0/contrib/
    http://FTP.Mozilla.org/pub/mozilla.org/Firefox/releases/30.0/contrib-localized/

    The package name should be similar to "firefox-30.0.en-US.solaris-10-fcs-sparc-pkg.bz2".

    Thank you!

    30.0 Firefox for Solaris was posted to http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/30.0/contrib/ July 4, 2014. Took them a while but better late than never.

  • I want to CLEAR all THE CORRECTION OF THE COLORS of all components of the package

    I want to erase any correction of the colors of all components of the package, so I can start any color correction again from scratch. How can I remove all the correction of the colors of all components of the package?

    Select all clips and remove the Color Correction in video Inspector.

    PS will not work if you have applied multiple effects.

  • Satellite Pro C70 - B - 12 c - installation of the Package of added value

    Hello technician,

    could someone explain how to install the PPV on the Satellite Pro C70 - B - 12 c.
    I installed Windows 7 on the new Machine and want to use the utility function key.

    I downloaded the compatible vap on the driver download site. In the next step, I tried to install the PPV on the Archive of Toshiba Extractor. If I let install it automatically, I m only get the ODBC Driver-Installation Windows. So I canceled the Installation of the ODBC driver - and start the program installation of archive extracted.

    After the complete Installation, the function keys and the utility of the Flash card can be used. But the Flash card utility displays badly on the assigned keys functions. for example, on the keyboard the F11 key shows the power of the speaker function.

    The Flash Card utility indicates the Escape key for the same function switch (speaker). After the Installation of the vap, none called buttons work.

    I ve tested the function Key Utility for Windows 8.1. But this test was unnecessary.

    Thank you very much for your help!

    Hello

    Installation of VAP is not very complicated.
    You need to download the package.
    Save it to the disk (to office) and unzip the package (right click on unzip)

    > In the next step, I tried to install the PPV on the Archive of Toshiba Extractor.
    I m just wondering what you mean by install over?

    As I said earlier, after a clean install of Windows 7, you could install the VAP. But first this package must be decompressed. To decompress the package, you can use a program like WinRAR or WinZip

  • Re: How to remove the Package of added value?

    I'm having issues (media buttons no longer work) with the package of added value of Toshiba (TAVP) on my Portege M800.
    I want to update, but I can't do it before removing the old version of the TAVP. When I try to install the new TAVP, I get an error message saying that I need to remove the old version first.

    Problem is, I can't find the TAVP on my "Add/Remove Programs" list The internet said it should be on the list, but it is not. The programs are on my computer.

    They do not seem to be among the programs 'package of added value '. How can I remove the TAVP?

    I use Vista and Win7 long on two laptops from Toshiba. On two of them Toshiba Value added Package is listed in the control panel > programs and features and then you can start to uninstall option.

    I've done this several times. It must be there. He is listed as TOSHIBA Value added Package. Check it out at the bottom of the list under T.

  • Satellite A660 - cannot install the package of added value

    Hello

    For some reason any my wireless didn't work and I discovered that the wireless switch was turned off,

    I tried to turn it on again but the shortcut key for the wireless next to the power button did not work.
    I uninstalled the package of value added and tried to install back value-added package but it was - this

    message from say RegDBGetItem failed (1). and it would not install.

    Is that what I can do without having to install the new os?
    I tried CNettoyez but it didn't work.

    Please help ~!

    I ve reinstalled VAP several times and have never seen anything like it.
    When VAP is removed from the laptop the system must be restarted and then you can install the latest version of VAP.

    Have you downloaded good PPV for your laptop model?
    Are you using the original pre-installed OS that you got with your laptop?

  • missing in the package update for iTunes 12.3.2.35x64 program

    Update iTunes on Windows PC with the 12.3.2.35x64 version 10

    ends with the MSG for a program missing from the package.

    No other indication. The older Version of iTunes remains unchanged.

    Any idea?

    For general advice, see troubleshooting problems with iTunes for Windows updates. Start by Missing MSI errors .

    The steps described in the second case are a guide to remove everything related to iTunes and then rebuild what is often a good starting point, unless the symptoms indicate a more specific approach.

    Review the other boxes and other support documents list to the bottom of the page, in case one of them applies.

    More information area has direct links with the current and recent buildings if you have problems to download, must revert to an older version or want to try the version of iTunes for Windows (64-bit-for old video cards) as a workaround for problems with installation or operation, or compatibility with QuickTime software or a third party.

    Backups of your library and device should be affected by these measures but there are links to backup and recovery advice there.

    TT2

  • Without opening the package. How can I know when this ink expires?

    Can I use the code on the packaging to know when this ink expires? I don't want to open it.

    Thank you. I appreciate your help!

    These ink cartridges have no expiration date, they do not have to be exhausted before a certain time. They have a guaranteed end date, which is lasermarked on the body of the cartridge.

    I hope this helps...

  • Hp3830: Msg said to remove the packaging

    Msg says remove packaging, power off the printer and turn it back on. I did it several times and Dan see no tape or cardboard. Ink cartridges must be placed on the far right.

    Hello

    Thank you for using the HP forum.

    Have you tried to check if there is no packing material inside the printer area print area?

    Open the dorr of the printer as you would to access ink cartridges and check if there are elements of the package.

    Thank you.

  • receive the package throw starrt and end of frame

    I have wann process the packet received serial throwing start and end frame and recording the real package

    What is the format of the package? You can use the subset of string and the length of the string if it is a fixed size. If the start and end of the frame are unique (never appear in your data) you can remove it with a regular expression or search and replace all.

  • Who remembers the name of a set of Japanese tile that came with windows 98, or came with the windows over the package?

    Who remembers the name of a set of Japanese tile that came with windows 98, or came with the windows over the package?

    Hello

    The set of tiles you speak: Desktop Taipei. This game is built with Windows 98.

  • After downloading patch time I get "files from the package are incompatible with files on your system.

    I am a representative of Microsoft online. I write on behalf of the client.

    When I try to download the patch of day light savings time I get message saying to mistake my "files from the package are incompatible with files on your system. It is a valid installation of Windows XP Home Edition and the disc. Laptop has code and valid sticker. I need the advance of patch.

    Pat

    Hello

    What region are you located?

    I suggest you follow the steps described in the following link:

    http://support.Microsoft.com/GP/dst_webcasts

    Check also on the following link:

    http://support.Microsoft.com/gp/cp_dst#TAB0

Maybe you are looking for