Object in the package.

Can what I store outside the public privateprocedures, the functions and variables?

Hello

This kind of question can easily answer simply have a look at the documentation:

http://docs.Oracle.com/database/121/LNPLS/packages.htm#LNPLS00901

A package is an object schema which includes exceptions, variables, constants, cursors and subprograms and logically related PL/SQL types. A package is compiled and stored in the database, where many applications can share its content.


Kind regards.

Alberto

Tags: Database

Similar Questions

  • [4.1] links of the object to the package bodies does not

    Steps to reproduce:

    (1) find a PL/SQL Package that is used in the body of another package

    2) go to the "Références" tab

    (3) see how records in the column 'Name' are blue and underlined-click, which implies an object binding, alias "click to open".

    (4) try to actually go to any object that has the 'PACKAGE BODY' in his column "TYPE". It does not work. Clicking on does nothing, neither does ctrl + click.

    Links to other types of objects appear to work correctly, including links with type = 'PACKAGE', i.e. the package specifications. It's pretty weird.

    Known, fixed problem in 4.1.1 patch (forthcoming).

  • ORA-04068: current state of the packages was waived - avoid

    Hello
    I fight with the bad behavior of developers that is, something like this:
    CREATE OR REPLACE PACKAGE pkg1 IS
    
    g_version VARCHAR2(20) := '7.3';
        TYPE t_id_kon IS RECORD(
        id_kon VARCHAR2(12),
        sr_id    NUMBER(5));
    
      TYPE t_id_kont IS TABLE OF t_id_kon INDEX BY BINARY_INTEGER;
      FUNCTION get_version RETURN VARCHAR2;
    END pkg1;
    /
    I did some tests and looks like when you recompile pkg1 with
    Global g_version variable it is ORA-04068 generated for all sessions using this pkg1 before recompiling.
    But what about type and table_type declared in pkg1 they cause same behavior as g_version global varialbe?

    And generally how to treat than the types of situations of application point of view, you must catch this exception and re-run your application just?
    concerning
    GregG

    Packages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.

    If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.

    And if you want to know how we prevent Jetty package States...

    Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.

    As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)

    This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' error...

    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * v_statevar;
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    
    *
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    

    And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add a column to the table.

    SQL> drop table dependonme
      2  / 
    
    Table dropped.
    
    SQL>
    SQL> drop package mypkg
      2  / 
    
    Package dropped.
    
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
  • error ORA-4068:-l' current state of the package is invalidated

    Hai friends,

    Please see this link

    Problem we faced, it is ' error ora-4068:-l' current state of the package is disabled "in the application.initiallly of customer, we migrated to oracle 9i and 10g 10.2.0.4.0

    We have discussed and obtained the solution as the timestamp of the objects may be different. (we expect the access rights of the table sys.obj$) pls see the link

    Re: oracle error-4068

    But now we are informed senior as below

    (1) error ora-4068 will come only when recompile us the view. is this true?

    (2) 6136074 bug is fixed in 10.2.0.4.0. is it?

    Gurus of give your valuable suggestions

    S

    Packages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.

    If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.

    And if you want to know how we prevent Jetty package States...

    Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.

    As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)

    This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' error...

    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * v_statevar;
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    
    *
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    

    And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add a column to the table.

    SQL> drop table dependonme
      2  / 
    
    Table dropped.
    
    SQL>
    SQL> drop package mypkg
      2  / 
    
    Package dropped.
    
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
  • Header of the package failed verification during the download of the package sfr

    Hello

    I am trying to download the package asasfr -5500 x-boot - 5.3.1 - 152.pkg. But every time, it comes with an error "package header failed verification - object of type 'NoneType' has no len() Please check that the package is not damaged. Abandoned update. "I tried with ftp and http. But every case the same thing happens. My question is whether this is the right package. The doc of Cisco, I read asasfr-sys - 5.3.1 - 44.pkg. But this version I have not found the site of download of cisco software.

    QW-SFR-boot > system install http://www.XXXXX.com/asasfr-sys-531-152.pkg
    Check

    Package header verification - object of type 'NoneType' no has no no len()

    Please check that the package is not damaged.
    Abandoned update.

    Thanks in advance.

    Sari

    Are you following the Quick Start Guide?

    As he ordered, first copy us the boot image module of firepower to the ASA, set it as the recovery for the module image, retrieve the module using this boot image and complete the installation complete by using the image of the system (step 7 in the Quick Start Guide). Until the first 6 steps are completed successfully, #7 will not work.

    Please show us the output of the show version and present the ASA cli module.

  • objects and the record type

    Hello experts.

    create type emp2_obj is object
    (
    objno number
    ,
    objname varchar2
    (20),
    objdept number
    );

    create type emp2_objarr is table of emp2_obj;

    and

    type emp2_rec is record
    (
    recno number
    ,
    recname varchar2
    (20),
    recdept number
    );

    create type emp2_recarr is table of emp2_rec ;

    Objects and types of records are created similar and have the same similar object.  Is it only advisable to use registration type if you use a collection in PL/SQL type... Please advice

    user13328581 wrote:

    the only reason why I ask is because he asked during an interview

    -Objects and the types of records are created similar and have the same similar object.  Is it only advisable to use registration type if you use a collection in PL/SQL type... Please advice

    Not at all.  You can use record types used with collection types outside.  They are a group concept.  If you want to group a set of values together (including fields), you can use a record.  It may be convenient.  You can send documents around proc and functions.

    Be aware that the record types are limited to procedures, functions, anonymous blocks and packages (i.e. PL/SQL), while the types of objects are stored in the dictionary of data as a separate Oracle objects (they can also have methods, the records may not).  Object types can be used in SQL, as said sol.beach types of records (outside of the intelligent pipeline situations) is for PL/SQL.

  • Run DBMS_STATS. SET_TABLE_STATS in the package

    Hello

    I tried to put the table of statistics through DBMS_STATS. SET_TABLE_STATS for the table, I'm not owner.

    When I use the command SQL * Plus, it works fine.

    When I use the same command in the package, I got an error:

    ERROR on line 1:

    ORA-20000: TABLE 'XXX '. "' YYYYY ' does not exist or insufficient privileges

    ORA-06512: at "SYS." DBMS_STATS", line 4455

    ORA-06512: at "SYS." DBMS_STATS", line 10128

    ORA-06512: at "TKPA. KOPA_ORP_RELACIJE', line 13

    ORA-06512: at line 2

    User a role DBA and ALTER, DELETE, INDEX, INSERT and SELECT, UPDATE, REFERENCES, ON COMMIT REFRESH, QUERY REWRITE, DEBUG, FLASHBACK on table.

    Y at - it an idea?

    Thank you and best regards.

    Maybe

    Read memos to use SET_TABLE_STATS in http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_stats.htm#ARPLS059

    To call this procedure, you must be the table owner, or you need the ANALYZE ANY privilege. For the objects belonged to SYS , you must be the owner of the table, or you must ANALYZE ANY DICTIONARY privilege or the SYSDBA privilege.

    Concerning

    Etbin

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25519/subprograms.htm#LNPLS00809 can be useful also

  • How to create a new object on the other list list

    Hello

    I'm trying to insert the result of a query in a list in order to put the new values based on the results of the first query: for example, I have this table which contains records:



    adfcal1.PNG


    My question is:OE to create a new list object on the other hand, if you see the picture shows my list, I want to create another list where I stock ordred values if we in line December we will put 1 in column 12 and if we April we put 1 in the 4th column and if we find in my current line November we put 1 in column 11 :

    I'm stuck in this function

    public List<VisiteCons> MyListResult() {

      
    Query query = em.createQuery("SELECT o FROM Visite o ");
      
    List<Visite> visites = query.getResultList();
      
    List<VisiteCons> result = new ArrayList<VisiteCons>();
      
    for(int row = 0 ; row < visites.size() ; row++) {

      
    int m1 = 0, m2 = 0, m3 = 0, m4 = 0, m5 = 0, m6 = 0, m7 = 0, m8 = 0, m9 = 0, m10 = 0, m11 = 0, m12 = 0;
      
    //Pour m1 january
      
    if(visites.get(row).getM1().equals("janvier")){
      m1
    = 1;
      
    }
      
    VisiteCons vc =  new VisiteCons( m1, m2, m3, m4, m5
      
    , m6, m7, m8, m9
      
    , m10, m11,m12);
      result
    .add(vc);
      
    }
      
    return  result;

    }

    VisiteCons is a constructor that I created.



    and this my entity:

    package model;

    import java.io.Serializable;

    Import javax.persistence.Column;

    Import javax.persistence.Entity;

    Import javax.persistence.Id;

    Import javax.persistence.NamedQueries;

    Import javax.persistence.NamedQuery;

    @Entity

    @NamedQueries ({@NamedQuery (name = "Visite.findAll", query = "select visit o o")})

    Visit/public class implements Serializable {}

    private public static final long serialVersionUID =-6069673717468618734 L;

    @Column (length = 4000)

    private String year;

    @Column (nullable = false, length = 100)

    customer private string;

    @Column (length = 4000)

    private String dep.

    @Column (length = 4000)

    private String State;

    @Id

    @Column (nullable = false, length = 100)

    private String idvisite;

    @Column (length = 4000)

    private String ingaff;

    @Column (length = 20)

    private String m1;

    @Column (length = 20)

    private String m10;

    @Column (length = 20)

    private String m11;

    @Column (length = 20)

    private String m12;

    @Column (length = 20)

    private String m2;

    @Column (length = 20)

    private String m3;

    @Column (length = 20)

    private String m4;

    @Column (length = 20)

    private String m5;

    @Column (length = 20)

    private String m6;

    @Column (length = 20)

    private String m7;

    @Column (length = 20)

    private String m8;

    @Column (length = 20)

    private String m9;

    @Column (length = 4000)

    private String moisvisite;

    @Column (length = 4000)

    private String nbvisites;

    @Column (length = 4000)

    private String prbvisite;

    public Visite() {}

    }

    Visit public (String year, String customer, String dep, State of, string idvisite, String ingaff, String m1,

    M10, m11 String, String m12, m2, m3, m4, m5 String String String String String, string m6, m7 of the chain,

    String m8, m9 String, String moisvisite, String nbvisites, String prbvisite) {}

    This.Annee = year;

    This.client = client;

    This.DEP = dep;

    This.Etat = State;

    This.idvisite = idvisite;

    This.ingaff = ingaff;

    This.M1 = m1;

    This.M10 = m10;

    This.M11 = m11;

    This.M12 = m12;

    This.M2 = m2;

    This.M3 = m3;

    This.M4 = m4;

    This.M5 = m5;

    This.M6 = m6;

    This.M7 = m7;

    This.M8 = m8;

    This.M9 = m9;

    This.moisvisite = moisvisite;

    This.nbvisites = nbvisites;

    This.prbvisite = prbvisite;

    }

    public String {} year

    return year;

    }

    {} public void Name\backup (String year)

    This.Annee = year;

    }

    public String getClient() {}

    customer feedback;

    }

    {} public void setClient (string customer)

    This.client = client;

    }

    public String getDep() {}

    return the dep;

    }

    {} public void setDep (String dep)

    This.DEP = dep;

    }

    public String getEtat() {}

    return status;

    }

    {} public void setEtat (String State)

    This.Etat = State;

    }

    public String getIdvisite() {}

    Return idvisite;

    }

    {} public void setIdvisite (String idvisite)

    This.idvisite = idvisite;

    }

    public String getIngaff() {}

    Return ingaff;

    }

    {} public void setIngaff (String ingaff)

    This.ingaff = ingaff;

    }

    public String getM1() {}

    return m1;

    }

    public void setM1 (String m1) {}

    This.M1 = m1;

    }

    public String getM10() {}

    return m10;

    }

    public void setM10 (String m10) {}

    This.M10 = m10;

    }

    public String getM11() {}

    return the m11;

    }

    public void setM11 (String m11) {}

    This.M11 = m11;

    }

    public String getM12() {}

    return m12;

    }

    public void setM12 (String m12) {}

    This.M12 = m12;

    }

    public String getM2() {}

    return m2;

    }

    public void setM2 (String m2) {}

    This.M2 = m2;

    }

    public String getM3() {}

    return m3;

    }

    public void setM3 (String m3) {}

    This.M3 = m3;

    }

    public String getM4() {}

    Return to m4;

    }

    public void setM4 (String m4) {}

    This.M4 = m4;

    }

    public String getM5() {}

    return m5;

    }

    public void setM5 (String m5) {}

    This.M5 = m5;

    }

    public String getM6() {}

    return of m6;

    }

    public void setM6 (String m6) {}

    This.M6 = m6;

    }

    public String getM7() {}

    return m7;

    }

    public void setM7 (String m7) {}

    This.M7 = m7;

    }

    public String getM8() {}

    back m8;

    }

    public void setM8 (String m8) {}

    This.M8 = m8;

    }

    public String getM9() {}

    return m9;

    }

    public void setM9 (String m9) {}

    This.M9 = m9;

    }

    public String getMoisvisite() {}

    Return moisvisite;

    }

    {} public void setMoisvisite (String moisvisite)

    This.moisvisite = moisvisite;

    }

    public String getNbvisites() {}

    Return nbvisites;

    }

    {} public void setNbvisites (String nbvisites)

    This.nbvisites = nbvisites;

    }

    public String getPrbvisite() {}

    Return prbvisite;

    }

    {} public void setPrbvisite (String prbvisite)

    This.prbvisite = prbvisite;

    }

    }

    You can create a view in the db which reads the data from the table and display it in a different way. Then you use the view to get the data in the format and display it in the user interface

    Sample:

    -create a test line

    Select 1 id, m1 'sep', 'mar' m2, m3 'Feb' from dual;

    -output:

    ID: M1 M2 M3

    ---------- --- --- ---

    1 sep mar Feb

    -which means that your table has a row with Id = 1 nd three visits (MS, mar and Feb).  Now give us a different look from these data using the select statement

    SELECT id,

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), "jan") > 0 then 'X' other ' ' end) jan.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| ((m3), "February") > 0 then 'X' other ' ' end) Feb.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), "mar") > 0 then 'X' other ' ' end) mar.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), ("apr") > 0 then 'X' other ' ' end) Apr.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| ((m3), 'can') > 0 then 'X' other ' ' end) may,

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), "jun") > 0 then 'X' other ' ' end) June,.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), "Jun") > 0 then 'X' other ' ' end) Jul.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| ((m3), "August") > 0 then 'X' other ' ' end) aug.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), "MS") > 0 then 'X' else ' ' end) Ms.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), 'OCTS') > 0 then 'X' other ' ' end) oct.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), "nov") > 0 then 'X' other ' ' end) nov.

    (case when ((m1||' +'|| m2 ||) instr)) » +'|| (m3), "dec") > 0 then 'X' other ' ' end) dec

    from (select 1 id, m1 'sep', 'mar' m2, m3 "feb" double);

    -output

    ID J F M A M J J A S O N D

    ---------- - - - - - - - - - - - -

    1 X X X

    or tabular

    You can create a similar sql statement (and there are better ways to do this, but I'm not the whiz sql) and use it to create a database from this view.

    I don't understand what you mean by

    .. and is there a solution of programmatly

    Timo

  • call a procedure of package DB type complicated if the type defined in the package itself

    Hello world

    I use jdev 11.1.1.7.0

    I defined a package of data with a procedure and internal two types as follows:

    Create Or Replace Package Db_Package As 
    
    Type rec Is Record(Rec_Type Varchar2(10), Rec_Desc varchar2(10) );                        
    Type recordList Is Table Of rec;
    
    Procedure Test_Procedure(p_out out recordList);
    END db_package;
    
    
    

    evil

    I want to call this procedure in the module of the application. I know how to call a procedure or function db AM,

    but in this case that I've defined two types in the package itself and I use one of these types as to the procedure output parameter, I had a problem.

    below is the example of code to call the db procedure, but it does not work because the plsqlBlock.registerOutParameter () setting will not

            CallableStatement plsqlBlock = null;
            String statement = "Begin DB_PACKAGE.Test_Procedure(:1); END;";
            try {
                plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);
                plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY);// it doesn't work
                plsqlBlock.executeUpdate();
                Object object = plsqlBlock.getObject(1);      
    
    
            } catch (Exception e) {
                e.printStackTrace();
            }
    
    
    
    

    I know that if I set the types of packets (rec, recordList) as types of oracle (instead of setting in the packaging itself) so I can call the procedure with success, in this case I should use below:

    plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY,"Recordlist");
    

    but I wonder how you can call a procedure from the package if the types defined in the package itself.

    Kind regards

    Habib

    JDBC supports the types of oracle level package only from 12 c database and jdbc driver ojdbc7 (which requires java 7).

    Dario

  • follow the package/db_link?

    Is there a way to know if any package calls a dblink?

    Oracle 11g - data warehouse.

    Here's the scenario.  Users log into a web application, and once connected, the application run reports on the data warehouse in points of view.

    There is a dblink once a week hitting the database of production to refresh the views.

    I want to know if one of the packets belonging to the same owner of the app schema, never remember the production tables for other reasons by the dblink.

    I tried to watch user_source, dba_db_links and some other places.  Nothing tells me what I need.

    How can I watch the database/system in a way to say: "ok, so this package/procedure/function/X running, and running on this dblink to another database."?

    Thank you.

    1416744 wrote:

    Looking at that, I'm trying to see where the correlation is to show me what I'm looking for.

    The only thing I can see the reference to East of global temporary tables.  Can you be more specific please?

    In dba/all/user_dependencies the referenced_link_name column will show the name (if any) of the database link used to reference the object in the referenced_name column.  The name column shows the object that refers to the object in the referenced_name column.

    I don't use synonyms for database links, if I'm not sure if the synonymous line in the dependencies table would show the name of the link, or not, but synonymous show.  If they do not appear in the table of dependencies, you could also look in the dba/all/user_synonyms table that has a column called db_link.

    John

  • table does not exist (when I try to compile the package)

    Hi all

    I can choose from table1 using simple script.

    But when I try to compile the package with select from it table1 I get the message:

    PL/SQL: ORA-00942: table or view does not exist

    Please help me understand how this is possible.

    What additional information should I place them here for you to help me?

    Thanks in advance.

    UPD: The object name is SYS. V_$ PROCESS

    I choose him by using script, so I need all grants.

    But what is the problem when I try to do in the package?

    2788367 wrote:

    Hi all

    I can choose from table1 using simple script.

    But when I try to compile the package with select from it table1 I get the message:

    PL/SQL: ORA-00942: table or view does not exist

    Please help me understand how this is possible.

    What additional information should I place them here for you to help me?

    Thanks in advance.

    It is very likely that you've got access to the table via a role. This allows you to use SQL to access.

    With packages, the grant must be directly to your schema, bypassing a role.

  • grant, create and drop objects on the diagram to a role/user

    Generic question for Oracle RDBMS:

    As far as I know, there is no way for the owner of a schema privileges such as create objects, or drop objects in this schema to a user or a role.

    I know that a lot of people always asked if it is possible, and I hope Oracle will provide this capability, but as far as I know, it is not possible, even in 12.1.0.2.

    Does anyone have ideas on this?

    I considered to have developers to create programs to create tables, views, packages, etc. and then grant execute on them to the users/roles, but it would be a huge amount of work.

    Did someone come up with an easier way to do this?  Or know of a way that this can be done?

    Obviously, I can not grant create any table, index, package, view, etc., or to delete any table, view, etc., and of course we grant the DBA role.

    I thought that the 'become a user"was a solution, but it is apparently far from able to do such things.

    In our case, apparently, we have users log in with account of the owner of the schema and create objects, modify objects, etc.  (Change the objects is not a problem, because we can give everything on the object to someone.)   The problem is that we need to prevent people to connect to shared group accounts (or as the owner of the schema record) to create objects, drop objects, etc.).  We all have as their own user name and will not be able to create and delete objects in patterns of selection.

    Why must everyone CREATE and DROP of objects within the framework or the processing of information on the day the day?

    I feel a serious design flaw & conversion Orace DB.

  • Integrate the Table function in the package

    Hey everybody,

    I had a problem with my table function. I don't have it created in a package as a function table on the database. Now I have to integrate it in my package,

    but it does not work. What I have to put the type and Assembly in the package_spec? I always get the error: "each cursor or subprogramm in the package_spec statement must have a corresponding definition in the package body.

    But I already joined the funtion in the body. Maybe someone can help me? I would be very grateful!

    It's my spec package: (sorry, I don't know how to insert the code in this forum, maybe you can tell me)

    The search_type is declared, but so far not in the package:

    ----------------------------------------

    create or replace package test is

    TYPE search_set IS TABLE OF THE schema.search_type;

    function search (.)

    Return search_set;

    end test;

    ----------------------------------------

    create or replace package test body is

    function search (.)

    return search_set

    pipelined is

    ..

    search for late;

    ----------------------------------------

    create or repplace type search_type as object

    (..);

    ---------------------------------------

    If I lump the search_type package specifications, it will not accecpt the 'object '.

    It would be great if you can help me! I would also like to update my post I have someone tell me how to integrate the code correctly in this post.

    Many thanks!

    In your message the definition of function in the SPECIFICATION does not PIPELINED keyword, but your BODY plan has it.

  • ODI the Package execution fails with ODI-1228 and ORA-20000 not sufficient privileges to analyze

    Hello

    I am trying to execute the package to ODI to have this error:

    Header 1

    ODI-1228: GATHER_SCHEMA_STATS-DW_STAGE (procedure) task fails when connecting ORACLE target ORACLE_SERVER.

    Caused by: java.sql.SQLException: ORA-20000: not sufficient privileges to analyze an object in the schema

    ORA-06512: at "SYS." DBMS_STATS", line 24867

    ORA-06512: at "SYS." DBMS_STATS", line 24945

    ORA-06512: at "SYS." DBMS_STATS", line of 24899

    ORA-06512: at line 2

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)

    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)

    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)

    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)

    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)

    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1115)

    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)

    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)

    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3954)

    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1539)

    at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:163)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)

    at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:744)

    (1) DW_STAGE and DW_REPORT have "ANY ANALYSER" and "UNLIMITED TABLESPACE" privilege and roles "S/n", 'CONNECT' and 'RESOURCE '.

    (2) agents are all running

    (3) tested ORACLE_SERVER and he succeeded

    Need for emergency assistance.

    Thanks in advance-

    ADI

    OK, I solved it.

    As part of Oracle under Technologies--> Oracle in the Studio of the ODI, I gave in the uid and password for DW_STAGE and it fixed the problem!

    Thank you all for your help and suggestions!

    ADI-

  • Database trigger can not see the package global variable after assign in my form

    Hello

    I faced the problem with the trigger and the package variable global using the form designer

    first of all, I get the local IP address machine using WEBUTIL in triggering of the PREFORM and initialize my global package variable by ' Client_Info_Pkg.Set_IP_Address (WEBUTIL_CLIENTINFO.» GET_IP_ADDRESS); ", then I tried to make the DML operation in my form and at the same time I trigger database also uses the package global variable of" Client_Info_Pkg.Gand_IP_Address; "to read in the package, and then insert it into the audit table


    The question this database trigger may not feel the initialization "Client_Info_Pkg.Set_IP_Address (WEBUTIL_CLIENTINFO. GET_IP_ADDRESS)' I did in triggering of the PREFORM and I used to wonder if oracle create new session to run this trigger so he can't see my boot or what?!. .

    the package

    CREATE OR REPLACE PACKAGE Client_Info_Pkg

    Global_IP_Address VARCHAR2 (100);

    FUNCTION Get_IP_Address RETURN VARCHAR2;

    PROCEDURE Set_IP_Address (p_Machine_Name IN VARCHAR2);

    END Client_Info_Pkg;

    /

    CREATE OR REPLACE PACKAGE BODY Client_Info_Pkg

    FUNCTION Get_IP_Address RETURN VARCHAR2 IS

    BEGIN

    RETURN Global_IP_Address;

    END;

    PROCEDURE Set_IP_Address (p_IP_Address IN VARCHAR2) IS

    BEGIN

    Global_IP_Address: = p_IP_Address;

    END;

    END Client_Info_Pk

    relaxation

    --------------

    CREATE OR REPLACE TRIGGER RUNERP.FO_DOC_TYPES_L_T

    BEFORE INSERT OR UPDATE OR DELETE ON FO_DOC_TYPES

    REFERRING AGAIN AS NINE OLD AND OLD

    FOR EACH LINE

    BEGIN

    IF THE INSERTION

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("I",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address' HELP: NEW.) DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    IF THE UPDATE CAN

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("U",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address) "USING: NEW." DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    IF REMOVE THEN

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("D",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address) "USING: NEW." DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    END;

    /

    Thanks in advance

    I solved my problem by using the CONTEXT object, Michael thank you for your interest.

Maybe you are looking for