Overloading a package with private procedures

Hi all

Is there a probelem if you overload a package with private procedures?
In other words if I have two methods named as in a package, of which none is declared in the pacakge specification? It seems that I always overloaded a package with public procedures.

Thanks for any help,
Bradley

I can:

SQL>CREATE OR REPLACE PACKAGE test
  2  AS
  3    PROCEDURE test_public;
  4  END  test;
  5  /

Package created.

Elapsed: 00:00:00.00
SQL>
SQL>sho err
No errors.
SQL>CREATE OR REPLACE PACKAGE BODY test
  2  AS
  3    PROCEDURE test_private (num IN NUMBER)
  4    IS
  5    BEGIN
  6      DBMS_OUTPUT.PUT_LINE('number: '||TO_CHAR(num));
  7    END test_private;
  8
  9    PROCEDURE test_private (str IN VARCHAR2)
 10    IS
 11    BEGIN
 12      DBMS_OUTPUT.PUT_LINE('string: '||str);
 13    END test_private;
 14
 15    PROCEDURE test_public
 16    IS
 17    BEGIN
 18      NULL;
 19      test_private(1);
 20      test_private('a');
 21    END test_public;
 22  END  test;
 23  /

Package body created.

Elapsed: 00:00:00.01
SQL>sho err
No errors.
SQL>
SQL>exec test.test_public
number: 1
string: a

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00
SQL>
SQL>select * from v$version;

BANNER
________________________________________________________________
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for Linux IA64: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

Elapsed: 00:00:00.04
SQL>

Tags: Database

Similar Questions

  • How to create a package with the procedures?

    Referring by the net, I've written the following PCK file. I installed my Oracle database 11g in VirtualBox (Win XP). I can able to select tables using the query from the host (Windows 7)

    CREATE OR REPLACE PACKAGE APEX_SYS_PCK

    AS

    TYPE refcursortype IS REF cursor

    PROCEDURE GET_USER_DETAILS)

    D1 ON refcursortype,

    P_USER IN VARCHAR2,

    P_PASS IN VARCHAR2);

    END APEX_SYS_PCK;

    /

    CREATE OR REPLACE PACKAGE BODY APEX_SYS_PCK

    AS

    PROCEDURE GET_USER_DETAILS)

    D1 ON refcursortype,

    P_USER IN VARCHAR2,

    P_PASS IN VARCHAR2)

    IS BEGIN

    OPEN D1 FOR SELECT * FROM APEX. PEOPLE;

    END GET_USER_DETAILS;

    END APEX_SYS_PCK;

    /

    When I try to run the script, I get the following error. How to solve this problem? If there is an error in this package please correct!

    • Project: sqldev.temp:/IdeConnections%23vAPEX.jpr
    • F:\PACKAGES\APEX_SYS_PCK. SQL
    • Error: PL/SQL: analysis of completed Compilation unit
    • Error (1.14): PLS-00905: APEX oppose. APEX_SYS_PCK is not valid
    • Error (1.14): PLS-00304: impossible to compile 'APEX_SYS_PCK' body without its specification

    You are missing a semicolon after

    TYPE refcursortype IS REF cursor

    in the specifications of your package.

  • Problem with stored procedure

    I use 10g, I have a 'PACK_SP' package with stored procedures, one of them is the following:
    PROCEDURE USP_ROWLARGESIZE(tablename VARCHAR2, cur_Types OUT CLOB,  v_namePrimaryKey OUT CLOB, cur_Result OUT CLOB) IS
    v_sql_str VARCHAR2(1000);
    v_ctx VARCHAR2(100);
    v_rowlength pls_integer;
    qryCtx DBMS_XMLGEN.ctxHandle;
    BEGIN
    
    -- Begin error stmt
    
    SELECT SYS.COL$.NAME INTO v_namePrimaryKey 
    FROM SYS.COL$ INNER JOIN SYS.OBJ$ ON SYS.COL$.OBJ# = SYS.OBJ$.OBJ# 
                  INNER JOIN SYS.CCOL$ ON SYS.COL$.OBJ# = SYS.CCOL$.OBJ# 
                  INNER JOIN SYS.CDEF$ ON SYS.CCOL$.CON# = SYS.CDEF$.CON# 
    WHERE SYS.OBJ$.NAME = tablename AND SYS.CDEF$.TYPE# = 2 AND SYS.COL$.COL# = SYS.CCOL$.COL#;
    
    -- End error stmt 
    
    (...)
    
    END USP_ROWLARGESIZE;
    As you can see, I have marked the statement with the error according to the OEM error message. The error text is: "Error Text = PL/SQL: ORA-00942: table or view does not exist. My goal is to store in the output parameter 'v_namePrimaryKey' the primary key column of a tablename. This query only works in more SQL query editor. Could someone help me?

    Thank you very much in advance!

    Published by: user9112176 on February 10, 2010 18:30

    Published by: user9112176 on February 10, 2010 18:31

    Published by: user9112176 on February 10, 2010 18:32

    Published by: user9112176 on February 10, 2010 18:33

    Published by: user9112176 on February 10, 2010 19:22

    System objects are accessible in SQL because they are visible through roles (DBA or SELECT_CATALOG_ROLE for example).

    However, the roles are disabled in PLSQL. You must have explicit privileges.
    That said, I would strongly advice you against writing code that references the SYS objects directly. You should use the USER_ or ALL_ % (or, if you really really must) the DBA_ % views.

    Hemant K Collette
    http://hemantoracledba.blogspot.com

  • Calling a procedure of package with only Date setting

    Hi all

    Please, help me to call a procedure of package with Date from the sql command prompt parameter.


    Arif

    Check the procedure below.

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure procdate (p_date_in date)
      2  is
      3  p_date_out date;
      4  begin
      5  p_date_out := add_months(p_date_in,6);
      6  dbms_output.put_line(p_date_out);
      7* end;
    SQL> /
    
    Procedure created.
    
    SQL> exec procdate('01-JAN-2010');
    01-JUL-10
    
    PL/SQL procedure successfully completed.
    
    SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
    01-JUL-10
    
    PL/SQL procedure successfully completed.
    
    SQL> exec procdate('31-DEC-2010');
    30-JUN-11
    
    PL/SQL procedure successfully completed.
    
  • Why we need to create the package instead of procedure or function in Oracle

    Hello

    Recently, I attended an interview, they asked,
    why we must create the package instead of procedure or function in oracle. Is a specific advantage, if we create together.
    I'm not sure. can u tell me please someone.

    Thank you and best regards,
    Sanjeev.

    Hello

    A part of the oracle documentation.

    What is a PL/SQL Package?
    A package is a schema object which includes subroutines, variables, and logically related PL/SQL types. Packages have two parts: a specification (spec) and a body. Sometimes, the body is unnecessary. The specification is the interface to the package. It declares the types, variables, constants, exceptions, cursors, and subprograms that can be referenced from outside the package. The body defines queries for the sliders and the code for the subprogrammes.

    Benefits of the PL/SQL Packages
    Packages have a long history in software engineering, offering important characteristics for a reliable, maintainable, and reusable code, often in team for large systems development efforts.

    Modularity

    Packages allow you to logically encapsulate Associates types, elements, and subroutines in a module named PL/SQL. Each package is easy to understand, and the interfaces between packages are simple, clear and well defined. This facilitates the development of applications.

    Easier application design

    When you design an application, all you need initially is the interface information in the package specification. You can code and compile a spec without his body. Stored subprograms that reference the package can then be compiled as well. You should not set the package body entirely until you are ready to complete the application.

    Information masking

    With packages, you can specify which types, elements, and subprogrammes are (and accessible) public or private (hidden and inaccessible). For example, if a package contains four subprogrammes, three can be public and one private. The package hides the implementation of the subprogramme private so that only the package (not your application) is affected if the application changes. This simplifies maintenance and improvement. Also, by hiding the implementation details of the users, you protect the integrity of the packaging.

    Feature added

    Sliders and packed public variables persist for the lifetime of a session. They can be shared by all the subprogrammes that are running in the environment. They allow you to manage data in any of the transactions without storing in the database.

    Best performance

    When you call a subprogram packaged for the first time, the whole package is loaded into memory. Subsequent calls to related subprograms in package require no disk i/o.

    Packets stop cascading dependencies and avoid an unnecessary recompilation. For example, if you change the body of a packaged function, Oracle does not recompile other routines that call the function; These routines only depend on parameters and return value that are declared in the specification, so they are recompiled only if the specification changes.

  • private procedures

    Hello people...

    1 q:

    When (at what situation), we use private functions/procedures do we get any actual condition on this... or what to hide access?

    2 q:

    When we choose statement level triggers and rowlevel... I know a generic example... allowing the transaction between 09:00-18:00... then we use the triggers statement-level, and when the shutter effects each record in the table use us row-level triggers... but is there any obvious requirement to use particularly statement-level triggers?

    Thank you very much

    In my project once, I used by mistake of mutation of determination. (unable to query a table even after insertion/update)

    I wrote a package with two prcedures and set of global variables...

    a single procedure will establish values to global variables. (this procedure will call a rowlvel trigger, only no action performed after update online level assignting only to variables)

    procerdure one another is going to make my action on the variables (call statement level trigger, such as statement-level trigger is not question of mutation, in my application for the always a specific table row will be updated for a statement)

    It is one of the reporting level requirement, I used there may be a lot of people.

  • Changing table via the package with immediate execution (problem)

    Hello

    I have a unusual problem. I have a package that contains the procedure that via execute immediate statement, creates a table on which he performs different actions for example:

    -alter table some_owner.dummy_table noparallel

    -create index some_owner.idx_name on some_owner.dummy_table (column)...

    But I only managed to run move and create synonym table/public via execute immediate statement. Actions as alter table and create index fails with error ORA-01031: insufficient privileges.

    Note If call these commands outside the package (a simple script) this all done OK.

    I found a way, where I set the AUTHID CURRENT_USER command create package statement. In this way all the actions executed OK.

    I wonder why I can't change the table via the package with immediate execution on a table that is in the tablespace "SOME_TABLESPACE" and the title of owner "SOME_OWNER", without putting the AUTHID command on the package.

    There must be a problem why a package cannot change the table which is owned by the user 'SOME_OWNER '.

    All useful responses would be appreciated.

    I have a unusual problem.

    No - you don't have. This question has been answered SEVERAL times on this forum and others.

    But I only managed to run move and create synonym table/public via execute immediate statement. Actions as alter table and create index fails with error ORA-01031: insufficient privileges.

    OK - your username doesn't have privileges to do these operations or only received privileges through roles.

    Roles are DISABLED in named PL/SQL blocks that use of the AUTHOR's rights.

    Note If call these commands outside the package (a simple script) this all done OK.

    I found a way, where I set the AUTHID CURRENT_USER command create package statement. In this way all the actions executed OK.

    Of course - the roles are NOT disabled in named PL/SQL blocks that use the rights of the APPELLANT or in anonymous blocks.

    I wonder why I can't change the table via the package with immediate execution on a table that is in the tablespace "SOME_TABLESPACE" and the title of owner "SOME_OWNER", without putting the AUTHID command on the package.

    Well now you know!

  • Private procedures and functions

    Hi all

    I am struggling to find a way to the list of private procedures and functions that are not declared in the package specification.
    Are there data dict. table or a view that could help

    DBA_procedures only the list procedure and functions that are declared in the package Spec.


    Thanks in advance.

    This is what the intended behavior is that if the procedure /function is prviate, it must not be visible. Have you tried to check in dba_source ?

    Aman...

  • extract the package and the procedure name in the code

    In my treatment of exceptions, I need to register the name of package and procedure I have the exception. How can I get these two names without manually coding the names?

    Thanks to anticipiation

    A better option is to get the package name and the line number

    An even better option is to use the pl/scope (when you are in 11g (not sure about 10g)):

    SQL> alter session set plscope_settings='identifiers:all'
    /
    Session altered.
    
    SQL> set serverout on
    
    SQL> create or replace package pkg
    as
       procedure p1;
    
       procedure p2;
    end pkg;
    /
    Package created.
    
    SQL> create or replace package body pkg
    as
       procedure get_scope (obj varchar2, line int)
       as
       begin
          for c in (select rpad (lpad (' ', 2 * (level - 1)) || name, 20, '.') || ' ' || rpad (type, 20) || rpad (usage, 20) identifier_usage_contexts
                    from user_identifiers t
                    where level != 1
                    start with line = get_scope.line and object_name = obj
                    connect by usage_id = prior usage_context_id)
          loop
             dbms_output.put_line (c.identifier_usage_contexts);
          end loop;
       end get_scope;
    
       procedure p1
       as
       begin
          null;
       end p1;
    
       procedure p2
       as
       begin
          get_scope ($$plsql_unit, $$plsql_line);
       end p2;
    end pkg;
    /
    Package body created.
    
    SQL> exec pkg.p2
    
      P2................ PROCEDURE           DEFINITION
        PKG............. PACKAGE             DEFINITION
        PKG............. PACKAGE             DECLARATION
    PL/SQL procedure successfully completed.
    
  • calling a package with in a select statement

    Hi all..

    I created two packages and pack8 called tabpack8 package... two different ways...
    There is an error with this statement
    Select the name MyName rab8 where place = tabpack8.test2 (myplace, 10);

    so... How can I call a package with in a select...


    CREATE or REPLACE PACKAGE tabpack8 authid current_user as
    procedure test1 (place out varchar2, myid number);
    function return number (place in varchar2, myid number) test2;
    end;
    /


    create or replace package body tabpack8 as
    procedure test1 (place out varchar2, myid number) is
    Start
    SELECT place of rab8 where id = myid;
    end Test1;
    function test2 (place in varchar2, myid number) return number is
    number of l_num;
    Start
    Select place in l_num rab8 where id = myid;
    Return l_num;
    end test2;
    END tabpack8;
    /

    CREATE or REPLACE PACKAGE pack8 authid current_user as
    operative;
    end;


    create or replace package body like pack8
    operation is
    MyPlace varchar2 (20);
    MyName varchar2 (20);
    Start
    tabpack8.test1(MyPlace,10);
    Select the name MyName rab8 where place = myplace;
    dbms_output.put_line ('Res-' | myname);

    Select the name MyName rab8 where place = tabpack8.test2 (myplace, 10);
    dbms_output.put_line ('Res-' | myname);
    end test;
    END pack8;
    /

    Thanks in advance
    gud day

    Try this and let us know.

    function test2(place in varchar2,myid in number ) return varchar2
    is
         l_var tab8.place%type;
    begin
         select place into l_var from tab8 where id = myid;
         return l_var;
    end test2;
    

    Thank you
    Knani.

  • Cisco ASA5520 facing ISP with private IP address. How to get the IPSec VPN through the internet?

    / * Style definitions * / table. MsoNormalTable {mso-style-name : « Table Normal » ; mso-tstyle-rowband-taille : 0 ; mso-tstyle-colband-taille : 0 ; mso-style-noshow:yes ; mso-style-priorité : 99 ; mso-style-qformat:yes ; mso-style-parent : » « ;" mso-rembourrage-alt : 0 à 5.4pt 0 à 5.4pt ; mso-para-marge-top : 0 ; mso-para-marge-droit : 0 ; mso-para-marge-bas : 10.0pt ; mso-para-marge-left : 0 ; ligne-hauteur : 115 % ; mso-pagination : widow-orphelin ; police-taille : 11.0pt ; famille de police : « Calibri », « sans-serif » ; mso-ascii-font-family : Calibri ; mso-ascii-theme-font : minor-latin ; mso-fareast-font-family : « Times New Roman » ; mso-fareast-theme-font : minor-fareast ; mso-hansi-font-family : Calibri ; mso-hansi-theme-font : minor-latin ;}

    Hello guys,.

    I have Cisco ASA5520 facing the ISP with private IP address. We don't have a router and how to get the IPSec VPN through the internet?

    The question statement not the interface pointing to ISP isn't IP address private and inside as well.

    Firewall configuration:

    Firewall outside interface Gi0 10.0.1.2 > ISP 10.0.1.1 with security-level 0

    Firewall inside the interface Ethernet0 192.168.1.1 > LAN switch 192.168.1.2 with security-level 100

    I have public IP block 199.9.9.1/28

    How can I use the public IP address to create the IPSec VPN tunnel between two sites across the internet?

    can I assign a public IP address on the Gig1 inside the interface with the security level of 100 and how to apply inside to carry on this interface?

    If I configure > firewall inside of the item in gi1 interface ip address 199.9.9.1/28 with security-level 100. How to make a safe lane VPN through this interface on the internet?

    I'm used to the public IP address allocation to the interface outside of the firewall and private inside the interface IP address.

    Please help with configuration examples and advise.

    Thank you

    Eric

    Unfortunately, you can only complete the VPN connection on the interface the VPN connection source, in your case the external interface.

    3 options:

    (1) connect a router in front of the ASA and assign your public ip address to the ASA outside interface.

    OR /.

    (2) If your ISP can perform static translation of 1 to 1, then you can always finish the VPN on the external interface and ask your provider what is the static ip address assigned to your ASA out of the IP (10.0.1.2) - this will launch the VPN of bidirectionally

    OR /.

    (3) If your ISP performs PAT (dynamic NAT), then you can only start the tunnel VPN on the side of the ASA and the other end of the tunnel must be configured to allow VPN LAN-to-LAN dynamics.

  • debugging packages with ASA 7.2 worm (2)

    Hello

    Previously with the version 6.3 of the PIX you can debug the packets in real time. That is to say with the command of debug package.

    Looking through the ASA 7.2 (2) order that the command of debug package no longer exists. If the order of packet - trace exists, is not in real time.

    Does anyone know how you debug packages with version 7.2 (2).

    Thank you

    Brett

    Create an ACL identify traffic that you want to debug. Create a capture specifying the ACL and the interface enters the circulation.

    Example:

    capture from the list of allowed access host ip x.x.x.x y.y.y.y

    capture mycapture access interface to capture inside list

    See capture mycapture detail dump

  • How to use Add the media offline option when creating packages with conditioner creative cloud.

    Hi all

    AM creating packages with Creative could conditioner, need to include 'Extension Manager CS6 ' to my list of requests, I downloaded a version and trying to add to the list with the help of add the option offline media, but get the error as media is not appropriate etc...

    Can any body please let me know how to add media offline while we creating packages with Creative Cloud Packager.

    Thanks in advance.

    This is possible in theory, as long as the source media that you add is complete and unzipped. Also if 32 bit it cannot be added to a 64-bit package and vice versa.

    It's not really what this feature is designed for good. It is designed for DVD sets provided to customers who live in areas where poor internet infrastructure that cannot download apps via CCP.

  • My photoshop has turned into a day 30 trial after upgrading my account to a package with lightroom included! What is going on?

    I have been subscribed to a single package Photoshop CC from 2013, and one of my friends said that I was paying too much, and I should at least have included Lightroom. So, I checked, asked a few questions to the (probably a bot) chat service, before I knew he was there, my possibility to opt for a package with photoshop and Lightroom (including bridge)
    It was time to update my existing bridge and photoshop. After doing this, all of a sudden my photoshop has changed in a 30-day trial! How can I fix it?

    FIXED! Re, I entered the cat, with the hope to fix with someone, and it is fixed!

  • I have PS 4, 5 and 6 is installed on my Macbook Pro and Lightroom 4 and 5. Can I remove PS 4 and 5 and 4 LR?  PS 4 is the entire plant and PS 5 and 6 are updated. LR 4 is the complete package with LR upgrade.

    I have PS 4, 5 and 6 is installed on my Macbook Pro and Lightroom 4 and 5. Can I remove PS 4 and 5 and 4 LR? PS 4 is the entire plant and PS 5 and 6 are updated. LR 4 is the complete package with LR upgrade.

    I need space!

    First of all, let me disabuse you of a misconception: Adobe all upgrades are FULL installers.  If you buy upgrades or new versions does not have one iota of difference.  Upgrade installation programs do not need to find a previous version installed, they invite you just for the old serial number as well as the old one and they are not based on the old version in the slightest.

    Second, the time to uninstall an earlier version is BEFORE upgrading to a newer version.  If not, uninstall older versions will mess up with your new installation.  There are a gazillion of the files that are named the same and in the same locations as the other.

    Your best bet now is to uninstall ALL versions of Photoshop, you have it installed, including the newest one, one by one, and then run the Adobe CS clean-up tool, and then run repair permissions of the Apple desktop utility and finally reinstall the latest version.

    The other alternative, if your boot HD is quite large (very questionable in the case of a laptop as a Mac Book), is to leave all the versions on this subject.

    Your choice.

Maybe you are looking for

  • How to write Modbus data in a file or a matrix?

    Hello: I can monitor my data through RS-485 port using 'Master Series MB query', and successfully, I can show signals using the waveform. But I can't save the data during the test in a table or write to a file. (see attachment and picture) How can I

  • My problem with Google Chrome

    Hello I use the latest version of the Google Chrome browser on my Windows 7 computer. The problem is that chrome is very slow in the first round. It takes more than 20 seconds to finally load the page (any page, say Google.com). Please consider these

  • Cannot send SMS on Verizon device

    Quote from the old forum: Comments Cannot send SMS on Verizon device Posted the: March 7, 2007 20:11   The following code snippet to send a text SMS using WMA works very well on a T-Mobile (e.g., 8700 g) and a Cingular device (e.g. 8700 c): Con Messa

  • Get the distinct data ID

    Hi allUsing this data I want to write a query to count the distinct ID that has 'transaction' and 'world' as a termwith fq as(select 1 id, the term "transaction" of the double)Union of all theSelect the id 1, the term 'world' of the doubleUnion of al

  • Can I re - open a dialog when a user clicks the Ok button?

    Hi allI would like to catch missing entry (selection of the menu drop-down) in an Illustrator scripted dialog box and return the user to the dialog box, as it was before he clicked on ok.Now the script logic goes in this direction: var windowResource