Invalid stored Object Types with Constructor Function

hi folks,
i created a stored object type on database 10.2. but it is invalid.
it has a constructor function and a number of member functions.
SQLPlus the only feddback is
Warning: Type Body is compiled with errors.
Toad 9.0.0 gives no error message.
how can i find out what kind of error there is? and where?
thx for help
joerg

In SQL*Plus, when you get a warning that you've created an object with compilation errors, you can type
SQL> show errorsto see the list of errors.
Justin

Similar Messages

  • Object type with constructor gets PLS-00307 (10g)

    Hi all,
    I have the following code, and I am getting the following error. I want to have a constructor that can be called without specifying the parameters by name. Is that not possible?
    What am I doing wrong?
    Thanks!
    Error:Error at line 50
    ORA-06550: line 5, column 17:
    PLS-00307: too many declarations of 'TRANSFEROBJECT_O' match this call
    ORA-06550: line 5, column 5:
    PL/SQL: Statement ignoredCode:DROP TYPE TransferObject_o
    CREATE TYPE
        TransferObject_o
    AS OBJECT
        m_objectId  NUMBER(15)
      , m_attribute VARCHAR2(4000)
      , CONSTRUCTOR FUNCTION TransferObject_o
            p_objectId  NUMBER--   := NULL
          , p_attribute VARCHAR2-- := NULL
        ) RETURN SELF AS RESULT
    CREATE TYPE BODY
        TransferObject_o
    AS
        CONSTRUCTOR FUNCTION TransferObject_o
            p_objectId  NUMBER--   := NULL
          , p_attribute VARCHAR2-- := NULL
        ) RETURN SELF AS RESULT
        IS
        BEGIN
            SELF.m_objectId  := p_objectId;
            SELF.m_attribute := p_attribute;
            RETURN;
        END;
    END;
    DECLARE
        l_object TransferObject_o;
    BEGIN
        l_object := TransferObject_o(1, 'B');
    END;
    /

    Hi,
    When you create an OBJECT, Oracle automatically creates a constructor with one argument for each of the object's attributes. You've created a second constructor, that has the same signature, except that the arguments in your functin are optional. When you call an overloaded routine ( whether it's a constructor or any other function or procedure), Oracle has to decide which of the versions you're calling. If you call the TransferObject_o constructor with fewer than two arguments, the system knows you mean the version you wrote, since the default constructor has two required arguments. But when you call the TransferObject_o constructor with exactly two arguments, it has no way of telling which version to use, and raises an error.
    The Oracle 10.1 "PL/SQL User's Guide and Reference" says:
    "You can define your own constructor methods, either overriding a system-defined constructor, or defining a new function with a different signature."
    I couldn't find an example of overriding the constructor (not that I spent a lot of time looking. If you find one, or figure out how to do it, please post an example or a link here.).
    Failing that, you can always give your constructor a different signature (e.g., put the VARCHAR2 argument first).

  • Type's constructor function is called as many times as there are attributes

    The constructor method for object types is being called multiple times by SQL when using the constructor in an SQL insert statement. For example, if I create an object type called TEST_O, and an object table TEST_OT based on type TEST_O, and then insert into TEST_OT using the constructor:
    INSERT INTO TEST_OT VALUES ( TEST_O( TEST_ID_SEQ.nextval, 'Test', USER, SYSDATE ) );
    The contructor is actually called 5 times by SQL. Here's a sample type, table, type body, and anonymous PL/SQL procedure that reproduces this error:
    create type TEST_O as object (
    test_o.tps
    by Donald Bales on 3/1/2007
    Type TEST_O's specification:
    A type for debugging object type problems
    test_id number,
    test varchar2(30),
    insert_user varchar2(30),
    insert_date date,
    -- Get the next primary key value
    STATIC FUNCTION get_id
    return number,
    -- A NULL values constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o)
    return self as result,
    -- A convenience constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    aiv_test in varchar2)
    return self as result,
    -- Override the defaul constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    test_id in number,
    test in varchar2,
    insert_user in varchar2,
    insert_date in date)
    return self as result,
    -- Write to the debug object table
    STATIC PROCEDURE set_test(
    aiv_test in varchar2),
    -- A map function
    MAP MEMBER FUNCTION to_map
    return number
    ) not final;
    grant all on TEST_O to PUBLIC;
    ========================
    create table TEST_OT of TEST_O
    tablespace USERS pctfree 0
    storage (initial 1M next 1M pctincrease 0);
    alter table TEST_OT add
    constraint TEST_OT_PK
    primary key (
    test_id )
    using index
    tablespace USERS pctfree 0
    storage (initial 1M next 1M pctincrease 0);
    drop sequence TEST_ID_SEQ;
    create sequence TEST_ID_SEQ
    start with 1 order;
    analyze table TEST_OT estimate statistics;
    grant all on TEST_OT to PUBLIC;
    ============================
    create or replace type body TEST_O as
    test_o.tpb
    by Donald Bales on 3/1/2007
    Type TEST_O's implementation
    A type for logging test information
    STATIC FUNCTION get_id
    return number is
    n_test_id number;
    begin
    select TEST_ID_SEQ.nextval
    into n_test_id
    from SYS.DUAL;
    return n_test_id;
    end get_id;
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(zero param)');
    self.test_id := NULL;
    self.test := NULL;
    self.insert_user := NULL;
    self.insert_date := NULL;
    return;
    end test_o;
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    aiv_test in varchar2)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(one param)');
    self.test_id := TEST_O.get_id();
    self.test := aiv_test;
    self.insert_user := USER;
    self.insert_date := SYSDATE;
    return;
    end test_o;
    -- Override the default constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    test_id in number,
    test in varchar2,
    insert_user in varchar2,
    insert_date in date)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(four params)');
    self.test_id := test_id;
    self.test := test;
    self.insert_user := insert_user;
    self.insert_date := insert_date;
    return;
    end test_o;
    STATIC PROCEDURE set_test(
    aiv_test in varchar2) is
    begin
    insert into TEST_OT values ( TEST_O(aiv_test) );
    end set_test;
    MAP MEMBER FUNCTION to_map
    return number is
    begin
    return test_id;
    end to_map;
    end;
    ====================
    begin
    TEST_O.set_test('Before loop');
    for i in 1..10 loop
    TEST_O.set_test('Testing loop '||to_char(i));
    end loop;
    TEST_O.set_test('After loop');
    commit;
    end;
    ==========================
    Which produces the following output:
    SQL> @test_o
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    PL/SQL procedure successfully completed.
    SQL> select * from test_ot order by 1;
    TEST_ID TEST INSERT_USER INSERT_DATE
    2 Before loop SCOTT 20070301 173715
    7 Testing loop 1 SCOTT 20070301 173715
    12 Testing loop 2 SCOTT 20070301 173715
    17 Testing loop 3 SCOTT 20070301 173715
    22 Testing loop 4 SCOTT 20070301 173715
    27 Testing loop 5 SCOTT 20070301 173715
    32 Testing loop 6 SCOTT 20070301 173715
    37 Testing loop 7 SCOTT 20070301 173715
    42 Testing loop 8 SCOTT 20070301 173715
    47 Testing loop 9 SCOTT 20070301 173715
    52 Testing loop 10 SCOTT 20070301 173715
    57 After loop SCOTT 20070301 173715
    12 rows selected.
    Is it possible to get an Oracle employee to look into this problem?
    Sincerely,
    Don Bales

    Here some sample JavaScript code that might help you resolve the issue.
    var curPageNum = xfa.host.currentPage + 1; // this is index
    // based starts with 0
    if (curPageNum == 1) {
    // run your current script here then it will run only one
    //time on page 1

  • 8.1.7 jdbc driver: object types with double quotes

    Hi all,
    While switching from 8.1.6 to 8.1.7 I have trouble with the jdbc driver. It doesn't work
    as before: The function CallableStatement.registerOutParameter (and probably some other) doesn't take object type
    names in double quotes anymore. A test program is appended to this message. Using a 8.1.6 jdbc driver this program works fine but with a 8.1.7 jdbc driver it throws an exception.
    My questions are: Is this bug already filed?
    Is a bugfix already available somewhere?
    Thanks in advance for any information
    Joerg
    import java.sql.*;
    * create type "test_t" as object (atrb number(10));
    * create table "test" of "test_t" (atrb not null) oidindex();
    class test
    public static void main (String args [])
    throws SQLException
    String s = "begin insert into \"test\" t values (1)" +
    " returning ref(t) into ?; end;";
    try{
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@host:1521:orcl","joerg", "password");
    CallableStatement cs = conn.prepareCall( s );
    cs.registerOutParameter(1, Types.REF, "\"test_t\"");
    cs.execute();
    System.out.println("Statement returned:");
    System.out.println( cs.getObject(1) );
    cs.close();
    conn.commit();
    conn.close();
    catch(SQLException e){
    System.out.println("SQLException was thrown...");
    System.out.println(e.getMessage());
    }

    I believe that typenames are always treated as case sensitive (unless they are all uppercased).
    In your example you should write:
    cs.registerOutParameter(1, Types.REF, "test_t");
    If you had declared the type test_t in a case insensitive way (without "..."), then you'd have to write:
    cs.registerOutParameter(1, Types.REF, "TEST_T");
    If you have a schema-qualified name, use a ".":
    cs.registerOutParameter(1, Types.REF, "SCOTT.test_t");
    However, this behavior implies that you cannot use "." inside of quoted identifier names.

  • How to use Object types with inheritance in design editor

    Does anyone know how to implement Oracle object sub types in Design editor.
    Is there a way of using the Database design transformer to convert entities to Object types rather than tables?
    Thanks in anticipation
    David

    What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
    It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
    The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics.

  • Read different SV's Type with one function

    Hi,
    I have a several type of Shared Variables in my Biblio, and I Like to read them using one function. So I have connected the type of data of the VI " Search variable Container" to an cluster wich within I put Boolean, numeric and character string Constant . But it doesn't work
    In your opinion it is possible to read several type of data with one function, Or should-I use several loops to read each type of Data?
    Attachments:
    Bib.JPG ‏12 KB

    You need to show a lot more than just the fact you have 3 variables.  How am I supposed to know what type they are?  Post your Read VI if you can.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Create new object (measure) with IIF function on BW Olap universe:mdx error

    hello
    i have a universe based on a BEX query
    i want to create a new object (a measure) with the IIF(,,) function
    i created the following select:
    <EXPRESSION>IIF(@Select(Currency Type\CurrencyTypeCode)="10",@Select(Key Figures\RevenueGlobalCurrency),@Select(Key Figures\RevenueLocalCurrency))</EXPRESSION>
    defined as number
    where
    CurrencyTypeCode is a dimension (character format)
    RevenueGlobalCurrency and RevenueLocalCurrency are measure (number format)
    i always have a parse which is OK but
    when i want to  use the object on a webi report i always have an MDX error : ...invalid MDX with .... (WIS 10901)
    and advise ?
    Thanks

    Hi Didier,
    Thanks a lot for your help.
    Now it works : i do not understand why
    i explain:
    the correct syntaxe of my new measure is :
    <EXPRESSION>([Measures].[4FVLHG7OAJMNY9WC06X6JLOZQ], [0CURTYPE].[10])</EXPRESSION>
    it does not works with my "L01 currency type" BO dimension
    ([0CURTYPE].[LEVEL01])
    when i had :
    -my universe is based on a BW BEX query
    -my universe has been automaticaly generated with the assistant
    -the Currency Type Class was define as below:
           - 1 BO dimension object : L01 Currency Type =>
    [0CURTYPE].[LEVEL01]
           - 3 BO detail objects : L01 Currency Type techName =>
    [0CURTYPE].[LEVEL01].[TECH_NAME]
                                              L01 Currency Type Key =>
    [0CURTYPE].[LEVEL01].[[20CURTYPE]].[Value]
                                             L01 Currency Type Long Name =>
    [0CURTYPE].[LEVEL01].[[40CURTYPE]].[Value]
    i always had a wrong mdx syntax error on the webi report
    i updated the class with the follow
         - 1 BO dimension object : L01 Currency Type =>
    [0CURTYPE].[LEVEL01] (idem)
           - 3 BO detail objects : L01 Currency Type techName =>
    [0CURTYPE].[LEVEL01].[TECH_NAME]  (idem)
                                              L01 Currency Type Key =>
    [0CURTYPE].[LEVEL01].[NAME] (updated)
                                             L01 Currency Type Long Name =>
    [0CURTYPE].[LEVEL01].[DESCRIPTION] (updated)
    then it was working
    Then i tried to reproduce from scratch and now it also works with the previous version of the class.
    I do not understand anything
    Is there something like a cache file of the MDX query (in RSRT, cache mode is set to inactive for the bex query) ?
    ps: this is the same if a use webi under infoview (java) or webi rich client...
    Edited by: Frederic Nez on Jan 19, 2010 6:35 PM
    (edit : there is mistake in the post : objects are always between [] even if it is not dispay => change objects to code mode)

  • How to manage non-SAP objects types with SAP Netweaver ?

    I would like to know how it is possible to integrate into the SAP software configuration managment tools (NWDI CTS, CTS+...) non-SAP objects like shell scripts or SQL requests ?
    These shell scripts are, for example:
    - external host scheduler jobs
    - general scripts for start/stop application
    - parameters needed by application at the os level
    My goal should to store into a DEV SAP system these objects, in order to take benefit of SE80 version management. So, it should be possible to create transport order in SE10 and to transport these non-SAP objects in test and production system.
    Thank in advance for your answers.
    Daniel Ouin

    the standard functionality for this up until 4.72 is to call RFCs/BAPIs through a RFC binding library for the third party software, e.g. the language of your choice is PHP then you use the PHP RFC library found [here|http://saprfc.sourceforge.net/], if you have to connect from a .NET environment you might try to get the SAP .NET connector.
    anton
    PS: RTFM and/or using the search facilities here on SCN would help you a lot with your task.

  • Asking for return type with constructor

    import java.swing.*;
    public class firstWindow extends JFrame
         public static final int WIDTH = 300;
         public static final int HEIGHT = 200;
         public FirstWindow()
              super();
              setSize(WIDTH,HEIGHT);
              JLabel newLabel = new JLabel("My Medical Record.");
              getContentPane().add(newLabel);
              WindowDestroyer listener = new WindowDestroyer();
              addWindowListener(listener);
    }Continue to get a 'method with no return type'. I looked for a syntax error but can't see it.
    Edited by: Zarnon on Mar 2, 2008 2:07 PM

    radiorx wrote:
    public FirstWindow()Class name is firstWindow, so the constructor should be re-named :
    public firstWindow()In the former case, the FirstWindow identifier creates a method rather than a constructor, and methods in Java need a return type.
    Hope this helpsInstead of renaming the constructor, rename the class file public class firstWindow extends JFrame into public class FirstWindow extends JFrame

  • Creting  object array  with constructor

    Hello all,
    Here is a query kindly let me know your views.
    Q) I want to create four objects and if i write a constructor how is it invoked..
    kidly help me ...
    thanks in advance
    mahesh

    Hello all,
    Here is a query kindly let me know your views.
    Q) I want to create four objects and if i write a
    constructor how is it invoked..
    kidly help me ...
    thanks in advance
    maheshYour question is very vague, very general, in short, impossible to really answer well. We need more specific information. A golden rule for forum questions: Please put as much effort into writing your question as you would wish someone would use answering your question.
    I look forward to hearing more from you.
    /Pete

  • Oracle Object type

    Can anyone tell me how to do this ? Thanks!!!
    i have a table dept (dept_no, description) and trying to create an object type with member function to insert the values into the table. I would like to know, whether I have to member function with input parameter or just newdept.dept_ins.
    create type depto OBJECT AS
    ( dept_no number(3),
    description varchar2(100),
    member PROCEDURE dept_ins);
    create type body depto
    member procedure dept_ins IS
    begin
    insert into dept(dept_no, description) values depto.dept_no, depto.description;
    end dept_ins;
    end;
    null

    Yould could check the type of the returned object:
    ResultSet rs = ... ;
    int columnIndex = ...;
    Object o = rs. getObject( columnIndex );
    System.out.println(o.getClass().getName());

  • Oracle Object Type Constructor Called Multiple Times

    I have an object type with a custom constructor. In SQL, when I reference the attributes the constructor is called multiple times in Oracle 11.2.0.4.
    Why is the constructor called multiple times?
    How do I stop it?
    My current work around is to reference the attributes and use the /*+ materialize */ hint.
    Problem Setup
        create or replace type Foo as object
          Bar1 NUMBER,
          Bar2 NUMBER,
          Bar3 NUMBER,
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
        create or replace type body Foo is
          -- Member procedures and functions
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
          AS
          BEGIN
            SELF.Bar1 := p_Bar1;
            SELF.Bar2 := p_Bar2;
            SELF.Bar3 := p_Bar3;
            dbms_output.put_line('Foo Constructor Called');
            RETURN;
          END;
        end;
    Problem
        -- Constructor is called 6 times!
        -- Once for each column and once for each predicate in the where clause.
        SELECT x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3, f
        FROM (
          SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
          FROM dual d
        ) x
        WHERE x.f.bar1 = x.f.bar1 AND x.f.bar2 = x.f.bar2
    Output
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Workaround
        -- Work Around
        -- Constructor is called 3 times
        -- Once for each column in the inline view.
        -- Note, I removed column f (the object type) because it's not compatible with the materialize hint.
        WITH y AS (
          SELECT /*+ materialize */ x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3
          FROM (
            SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
            FROM dual d
          ) x
        SELECT y.bar1, y.bar2, y.bar3
        FROM y
        WHERE y.bar1 = y.bar1 AND y.bar2 = y.bar2

    Another work-around is described in this thread... Accessing fields of a custom object type... which makes use of a collection type combined with the TABLE operator, like so...
    create or replace type FooTable as table of Foo;
    SELECT x.bar1 AS bar1, x.bar2 AS bar2, x.bar3 AS bar3, value(x) f
        FROM table(FooTable(
          foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3)
        )) x
        WHERE x.bar1 = x.bar1 AND x.bar2 = x.bar2
    BAR1 BAR2 BAR2 F
    1    2    3    (1, 2, 3)
    Foo Constructor Called
    Hope that helps...
    Gerard

  • Cannot call member function on object type

    On 8.1.6 I cannot call a member function from SQL in the way described in the manual.
    The following example is almost copied from the manual:
    create or replace TYPE foo AS OBJECT (a1 NUMBER,
    MEMBER FUNCTION getbar RETURN NUMBER);
    create or replace type body foo is
    MEMBER FUNCTION getbar RETURN NUMBER is
    begin
    return 45;
    end;
    end;
    CREATE TABLE footab(col foo);
    SELECT col,foo.getbar(col) FROM footab; -- OK
    select col,col.getbar() from footab; -- ERROR
    The second select is the way it should be, but I get an error "invalid column name".
    Using the first select, I get the result. This is strange because this is more or less the 'static member' notation (filling in the implicit self parameter myself).
    Is this a known bug in 8.1.6, maybe fixed in later versions?

    Konstantin,
    Did you use loadjava to load the compiled class into the Oracle Database?
    Regards,
    Geoff
    Hello!
    I need to write a member function for object type with java.
    for example:
    create type test as object(
    id number,
    name varchar2(20),
    member function hallo return number);
    create type body test as
    member function hallo return number
    as language java
    name 'test.hallo() return int;
    create table test of test;
    My java-file is:
    public class test {
    public int hallo() {
    return 5;
    select t.hallo() from test t;
    It's does not run. Why?
    I get always an error back. Wrong types or numbers of parameters!!
    please help me.
    thanks in advance
    Konstantin

  • DISTINCT on object type collection not working with GROUP BY

    Hello,
    I have an object type with collection defined as:
    create or replace type individu_ot as object (
       numero_dossier          number(10),
       code_utilisateur        varchar2(8 char),
       nom                     varchar2(25 char),
       prenom                  varchar2(25 char),
       map member function individu_map return number
    create or replace type body individu_ot is
       map member function individu_map return number
       is
       begin
          return SELF.numero_dossier;
       end individu_map;
    end;
    create or replace type individu_ntt is table of individu_ot
    /When I use it in simple SQL without any aggregation, the distinct keyword works well and returns me the distinct entry of my object type in the collection:
    SQL> select cast(collect(distinct individu_ot(indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom)) as individu_ntt) as distinct_list
    from   site_section_cours    sisc
              inner join enseignant_section_mc   ensemc
              on sisc.code_session = ensemc.code_session and
                 sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
              inner join individu_mc indivmc
              on ensemc.numero_dossier_pidm = indivmc.numero_dossier
    where  sisc.seq_site_cours = 6
    DISTINCT_LIST(NUMERO_DOSSIER,CODE_UTILISATEUR,NOM,PRENOM)                                                                                                                                                                                            
    INDIVIDU_NTT(INDIVIDU_OT(15,PROF5,Amidala,Padmé))                                                                                                                                                                                                    
    1 row selected.However in SQL with broader selection with group by, the distinct isn't working anymore.
    SQL> select *
    from   (
             select sisc.seq_site_cours,
                    cast(collect(distinct individu_ot(indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom)) as individu_ntt) as distinct_list
             from   site_section_cours      sisc
                       inner join enseignant_section_mc   ensemc
                       on sisc.code_session = ensemc.code_session and
                          sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
                       inner join individu_mc indivmc
                       on ensemc.numero_dossier_pidm = indivmc.numero_dossier
             group by sisc.seq_site_cours
    where seq_site_cours = 6
    SEQ_SITE_COURS DISTINCT_LIST(NUMERO_DOSSIER,CODE_UTILISATEUR,NOM,PRENOM)                                                                                                                                                                                            
                 6 INDIVIDU_NTT(INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé))                                                    
    1 row selected.there is case where I need to return more than one collections, with distinct entries in it.
    Is there something I am missing?
    Thanks
    Bruno

    Not a bug, rather an undocumented feature.
    Here are some alternatives you might want to test :
    1) Using the SET operator to eliminate duplicates :
    SELECT sisc.seq_site_cours,
           set(
             cast(
               collect(individu_ot(indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom))
               as individu_ntt
           ) as distinct_list
    FROM site_section_cours sisc
         INNER JOIN enseignant_section_mc ensemc
                 ON sisc.code_session = ensemc.code_session
                 AND sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
         INNER JOIN individu_mc indivmc
                 ON ensemc.numero_dossier_pidm = indivmc.numero_dossier
    GROUP BY sisc.seq_site_cours
    ;2) Using MULTISET with a subquery
    SELECT sisc.seq_site_cours,
           CAST(
             MULTISET(
               SELECT distinct
                      indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom
               FROM enseignant_section_mc ensemc
                    INNER JOIN individu_mc indivmc
                            ON ensemc.numero_dossier_pidm = indivmc.numero_dossier
               WHERE sisc.code_session = ensemc.code_session
               AND sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
             AS individu_ntt
           ) AS distinct_list
    FROM site_section_cours sisc
    ;

  • Retriving data through stored procedure returning Table of object type

    I am trying to retrieve the data returned as a table(secret_tab_type) of object type(secret_type). Now we can get the secret_tab_type table through
    rset = (ResultSet) cstmt.getObject(1); but how to map the SQL object type to Java object type ??
    FUNCTION Fetchthat(
    secretinfo      out      SECRET_TAB_TYPE,
    message     OUT varchar2
    ) return number;
    These are the declaration of secret_type object and secret_tab_type(table returned by fetchthat procedure)
    create or replace type secret_type as object
    (secret_id number(3),
    secret_question varchar2(100),
    valid_flag char);
    create or replace type secret_tab_type as table of secret_type;

    Amit,
    Your question has been previously asked (and answered) on this forum. I suggest searching this forum's archives for the terms STRUCT and ARRAY.
    For your benefit, here are the results of my search:
    http://tinyurl.com/auvl8
    Good Luck,
    Avi.

Maybe you are looking for

  • How can I mount a server to the desktop?

    When I open the Finder, under SHARED there is my old friend Communications Server. I cannot figure out how to mount a shortcut to it on the desktop.

  • Speech analysis not working, even for english - CC 7.0.1, OSX

    My research around the forum suggests that there IS a bug for this, but only for languages OTHER than english. I beg to differ... In my case, I have not installed any additional language packs, and the "Analyze..." button in the speech analysis part

  • Question about the import process in UC&CU upgrade

    Hi, We have are doing an UC&CU upgrade ( 4.7 => ERP6 ehp4) We have export the database (unicode converssion) and we are in the step where it's the import. I would to kno what i have to do in this SAPinst step : Database Schema Database objects have b

  • HR Workflow on New Employee Creation

    hi Experts,                  I need to triger work flow whenever an employee is hired or rehired for this work flow what is the business object,Info Type and Event. To be more specific when ever a new emp is crearted  a mail notification should be se

  • Problem in get_lead_selection_index( ). . pls help

    Hi frnds, I have two tables.. one below the other.. the below table has drop down values. lets say table2 the above has the item list. lets say table1 WHen a new record is selected in the table 1, the below table2 has to update few values. for that i