Alter type to add a member function

Hello,
I have Oracle 9i r2 and I really nedd to add a member function into an Object that is associated to other.
My Object spec is this:
TYPE CM_CTRL_CM AS OBJECT
lo_Ent_CM CM_Ent_CM,
member function IniEntCM(self in out CM_Ctrl_CM) return integer
I do this to add a member function:
alter type CM_Ctrl_CM add member function FijDatCM(ao_DatCM in CM_DatCM) return integer cascade ;
And as the result I get the nex the Object Spec:
TYPE CM_CTRL_CM AS OBJECT
lo_Ent_CM CM_Ent_CM,
member function IniEntCM(self in out CM_Ctrl_CM) return integer
alter type CM_Ctrl_CM add member function FjDatCM(ao_DatCM in CM_DatCM) return integer cascade
As you can see, all the alter type statement is added at the end of my Object Spec wich cause a compilation error and the object get invalid.
I need to know how to add a member function. It's very important for the my project successfull.
Thanks.
Luis Silva

And as the result I get the nex the Object Spec:
TYPE CM_CTRL_CM AS OBJECT
lo_Ent_CM CM_Ent_CM,
member function IniEntCM(self in out CM_Ctrl_CM) return integer
alter type CM_Ctrl_CM add member function FjDatCM(ao_DatCM in CM_DatCM) >> return integer cascade
/**************************************************************************************/Fnord. What is this supposed to mean?
Let me introduce you to a very technical skill known only to the illuminati: cut'n'paste. Using this skill you will be able to transmit information across great differences.
To use cut'n'paste:
(1) Open a reply to this message.
(2) Run your code in SQL*Plus.
(3) Highlight the code and the feedback and use the editor command to cut the code.
(4) Return to the forum and use the editor command to paste the result.
(5) Post
See what you've posted obviously is not from SQL*Plus. Maybe it's some other IDE. But we're stupid. If you show us output from SQL*Plus we can diagnose the problem otherwise we're flying blind.
Oh, and please include the code for CM_Ent_CM, as we can't run your SQL without it.
Cheers, APC

Similar Messages

  • 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

  • Member function and member procedure inside an object type in Oracle.

    Hi All,
    Please do have a look at these codes and help me understand. I have no idea about this member function and member procedure. How do they work? Please explain me about this.
    Regards,
    BS2012
    create type foo_type as object (
      foo number,
      member procedure proc(p in number),
      member function  func(p in number) return number
    create type body foo_type as
      member procedure proc(p in number) is begin
        foo := p*2;
      end proc;
      member function func(p in number) return number is begin
        return foo/p;
      end func;
    end;
    /

    Methods are just like functions or procedures in a package, except they're not in a package, their part of an object type.
    The object has attributes (which are the variables declared in it).
    To use such an object you would do things like this...
    SQL> set serverout on
    SQL>
    SQL> declare
      2    v_foo foo_type;
      3    v_val number;
      4  begin
      5    v_foo := foo_type(20); -- instantiate the object and initialize the object attributes
      6    v_foo.proc(20); -- call the object method (proc)
      7    v_val := v_foo.func(4); -- call the object method (func)
      8    dbms_output.put_line(v_val);
      9  end;
    10  /
    10
    PL/SQL procedure successfully completed.The Type definition you've declared creates the object class, but not actually an object itself.
    To actually have an object you need to declare a variable of that object class type, and then instantiate it. When you instantiate the object you need to initialize all the attributes (generally you can pass null if required for each of them to initialize them).
    Once you have your object instantiated, you can call the methods within that object as demonstrated above, a bit like calling functions and procedures in a package, except they are methods within the object type itself, and therefore called directly by referencing them from the variable.
    The documentation goes into a lot more detail of objects if you look it up.

  • [svn] 1543: Bug: BLZ-152-lcds custom Date serialization issue - need to add java.io. Externalizable as the first type tested in AMF writeObject() functions

    Revision: 1543
    Author: [email protected]
    Date: 2008-05-02 15:32:59 -0700 (Fri, 02 May 2008)
    Log Message:
    Bug: BLZ-152-lcds custom Date serialization issue - need to add java.io.Externalizable as the first type tested in AMF writeObject() functions
    QA: Yes - please check that the fix is working with AMF3 and AMFX and you can turn on/off the fix with the config option.
    Doc: No
    Checkintests: Pass
    Details: The problem in this case was that MyDate.as was serialized to MyDate.java on the server but on the way back, MyDate.java was serialized back to Date.as. As the bug suggests, added an Externalizable check in AMF writeObject functions. However, I didn't do this for AMF0Output as AMF0 does not support Externalizable. To be on the safe side, I also added legacy-externalizable option which is false by default but when it's true, it restores the current behavior.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-152
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/AbstractEndpoint.ja va
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/io/SerializationContext.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/io/amf/Amf3Output.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/io/amfx/AmfxOutput.java
    blazeds/branches/3.0.x/resources/config/services-config.xml

  • Input solicited: List function support as member functions in CFML

    G'day:
    I'm concerned about how Adobe have implemented the list-oriented member functions in ColdFusion 11. And I was hopeing to capture some community input as to what other people think, before raising it with Adobe:
    Survey: lists in CFML, and the naming of list member functions
    It'd be cool if you could take the time to complete the survey.
    Thanks.
    Adam

    ruerric wrote:
    I created a custom class called Rooms with all the appropriate setters and getters.Arguably, getters and setters are seldom appropriate.
    I iterated through a csv file and input all of the data into my custom object class and then put that object into a list by using list.add().
    Now I want to access the class methods through the use of the list.. how can I do so?
    How I declared my list:
    List list = new ArrayList<Rooms>(); // List implemented as growable array
    Rooms xxx = (Rooms).list.get(20);
    Says illegal start of type error.. What are you actually trying to accomplish here? Is list a static field of Rooms?
    Also, I want to sort the list by the room capacity. My Rooms class has a .setCap and .getCap function but how can I sort the list using that?
    From what I know about list.. it has a sort method but not exactly the way I want to sort a custom made class object..List doesn't have a sort method. There's a method in java.util.Collections to sort a list. I think it's "sort". You can pass it a java.util.Comparator that you write, to sort by whatever criteria you like.
    Question: will the capacity of a room ever change? In real life, if you build a hotel, and a room has a capacity of 3 persons, does the room ever change capacity? If the capacity never changes, then it's debatable whether you really need a setCap() method. It would be better to set the capacity once, in the constructor, and leave it.

  • Not able to get distict values even after defining  MAP MEMBER FUNCTION

    Hi,
    I am trying to get distinct values from a query to a table type. Please see the code below
    CREATE OR REPLACE TYPE T_COPY_EVNT_DTL
    IS
      OBJECT
        eventId               VARCHAR2(100),
        eventDescription      VARCHAR2(100),
        promoMonthDescription VARCHAR2(100),
        promoStartDate        VARCHAR2(100),
        promoEndDate          VARCHAR2(100),
        PROMOCOSTSTARTDATE    VARCHAR2(100) ,
        MAP MEMBER FUNCTION sort_key
        RETURN VARCHAR2 );
    CREATE OR REPLACE TYPE BODY T_COPY_EVNT_DTL
    AS
      MAP MEMBER FUNCTION sort_key
      RETURN VARCHAR2
    IS
    BEGIN
      RETURN eventId ;
    END;
    END;
    CREATE OR REPLACE TYPE T_EVENT_TABLE
    IS
      TABLE OF T_COPY_EVNT_DTL;
              with event_data as (
    select '1' event,'event1' event_desc,'monthdesc1' promo_month_desc ,'01/01/2001' promo_start_date     ,'01/01/2002' promo_end_date,'01/02/2001' promo_cost_start_date from dual union all     
    select '1' event,'event1' event_desc ,'monthdesc1'promo_month_desc ,'01/01/2001' promo_start_date     ,'01/01/2002' promo_end_date,'01/02/2001' promo_cost_start_date from dual union all
    select '3' event,'desc3' event_desc ,'monthdesc3' promo_month_desc,'01/01/2001' promo_start_date     ,'01/01/2002' promo_end_date,'01/02/2001' promo_cost_start_date from dual union all
    select '2' event ,'desc2' event_desc ,'monthdesc2' promo_month_desc ,'01/01/2001' promo_start_date     ,'01/01/2002' promo_end_date ,'01/02/2001' promo_cost_start_date from dual )
    SELECT  cast(collect(distinct t_copy_evnt_dtl(event,
                                                                                                                        event_desc,
                                                                                                                        promo_month_desc,
                                                                                                                        promo_start_date,
                                                                                                                       promo_end_date,
                                                                                                                  promo_cost_start_date) ORDER BY
                                                                event_desc,
                                                                promo_month_desc,
                                                                promo_start_date,                                                   
                                                                promo_end_date,                                           
                                                                promo_cost_start_date) as t_event_table)  from event_data;
    result :
    T_EVENT_TABLE('T_COPY_EVNT_DTL('2','desc2','monthdesc2','01/01/2001','01/01/2002','01/02/2001')',
              'T_COPY_EVNT_DTL('3','desc3','monthdesc3','01/01/2001','01/01/2002','01/02/2001')',
              'T_COPY_EVNT_DTL('1','event1','monthdesc1','01/01/2001','01/01/2002','01/02/2001')',
              'T_COPY_EVNT_DTL('1','event1','monthdesc1','01/01/2001','01/01/2002','01/02/2001')')Please help me to find out the reason why it is not working...

    Remove the comma from T_COPY_EVNT_DTL TYPE.
    ORA-22800 indicates invalid user-defined type.
        PROMOCOSTSTARTDATE    VARCHAR2(100) ,
        MAP MEMBER FUNCTION sort_keyAnd it will be fine.
    SQL> CREATE OR REPLACE TYPE  T_COPY_EVNT_DTL
      2  IS
      3    OBJECT
      4    (
      5      eventId               VARCHAR2(100),
      6      eventDescription      VARCHAR2(100),
      7      promoMonthDescription VARCHAR2(100),
      8      promoStartDate        VARCHAR2(100),
      9      promoEndDate          VARCHAR2(100),
    10      PROMOCOSTSTARTDATE    VARCHAR2(100),
    11      --,
    12      MAP MEMBER FUNCTION sort_key
    13      RETURN VARCHAR2 );
    14  /
    Type created
    SQL>
    SQL> CREATE OR REPLACE TYPE BODY T_COPY_EVNT_DTL
      2  AS
      3    MAP MEMBER FUNCTION sort_key
      4    RETURN VARCHAR2
      5  IS
      6  BEGIN
      7    RETURN eventId ;
      8  END;
      9  END;
    10  /
    Type body created
    SQL>
    SQL> CREATE OR REPLACE TYPE T_EVENT_TABLE
      2  IS
      3    TABLE OF T_COPY_EVNT_DTL;
      4  /
    Type created
    SQL>
    SQL>     with event_data as (
      2  select '1' event,'event1' event_desc,'monthdesc1' promo_month_desc ,'01/01/2001' promo_start_date  ,'01/01/2002' promo_end_date,'01/02/2001' promo_cost_start_date from dual union all
      3  select '1' event,'event1' event_desc ,'monthdesc1'promo_month_desc ,'01/01/2001' promo_start_date  ,'01/01/2002' promo_end_date,'01/02/2001' promo_cost_start_date from dual union all
      4  select '3' event,'desc3' event_desc ,'monthdesc3' promo_month_desc,'01/01/2001' promo_start_date  ,'01/01/2002' promo_end_date,'01/02/2001' promo_cost_start_date from dual union all
      5  select '2' event ,'desc2' event_desc ,'monthdesc2' promo_month_desc ,'01/01/2001' promo_start_date  ,'01/01/2002' promo_end_date ,'01/02/2001' promo_cost_start_date from dual )
      6  SELECT  cast(collect(distinct t_copy_evnt_dtl(event,
      7                                                 event_desc,
      8                                                 promo_month_desc,
      9                                                 promo_start_date,
    10                                                promo_end_date,
    11                                              promo_cost_start_date) ORDER BY
    12                          event_desc,
    13                          promo_month_desc,
    14                          promo_start_date,
    15                          promo_end_date,
    16                          promo_cost_start_date) as t_event_table)  from event_data;
    CAST(COLLECT(DISTINCTT_COPY_EV
    <Object>

  • Explicit assignment to the ref parameter in member function doesn't work

    I've created new member procedure in a simple DB schema (Profesor-Asignatura-Departamento). In this procedure I'd like to change explicitly the value of departamento parameter which stores references to departamento objects.
    So what I'm doing is:
    select ref(d) into ref_departamento from departamento d where d.codigo=n_departamento; -- retrieve reference to the departament which has a code=n_departamento
    then I'd just like to assign the result to objects attribute like this:
    self.departamento:=ref_departamento;
    and here it doesn't work and I'm wondering why; I haven't found explaination in web. No error is displayed, simply it doesn't change the previous value of the parameter.
    Maybe there are some restrictions. I've managed to find another solution here with UPDATE statement but I'm curious why the simple assignment doesn't work.
    Thanks in advance,
    Wojtek

    OK, I'm not spanish however I like my code to be kept that way because I'm still learning :)
    Most important classess are these (then tables are created for them):
    create or replace type ot_departamento as object
    codigo number,
    nombre varchar2(32),
    telefono vt_telefono, -- vector type of size 3
    profesores tt_departamento_profesores, -- table type of references to ot_profesor objects
    asignaturas tt_departamento_asignaturas -- table type of references to ot_asignatura objects
    create or replace type ot_profesor as object
    codigo number,
    nombre varchar2(32),
    direccion ot_direccion, --object type with street, city, etc.
    telefono vt_telefono,
    departamento ref ot_departamento, -- reference to ot_departamento
    docencia tt_profesor_docencia, -- table type of objects which attributes are (reference to ot_asignatura, credits for a subject)
    create or replace type ot_asignatura as object
    codigo number,
    nombre varchar2(32),
    departamento ref ot_departamento, -- reference to ot_departamento
    docencia tt_asignatura_docencia, -- table type of objects which attributes are (reference to ot_profesor, credits for a subject)
    member procedure cambio_departamento(n_departamento number) *<- That's the procedure, where I had this issue* its task is to change current department,it takes as an argument code of new department which needs to be assigned
    So now the code for my procedure is:
    create or replace
    type body ot_asignatura as
    member procedure cambio_departamento(n_departamento number) is
    asig_count number:=self.docencia.count;
    no_cambio exception;
    docencias_adscritas exception;
    ref_departamento ref ot_departamento;
    begin
    --first check if a department of given code (n_departamento) exists at all, if not then raise NO_DATA_FOUND exception
    select ref(d) into ref_departamento from departamento d where d.codigo=n_departamento;
    --check if the given department is not the same as asignatura has already assigned, if so then raise NO_CAMBIO (NO_CHANGE) exception
    if ref_departamento=self.departamento then
    raise no_cambio;
    end if;
    --if there are any docencias (subject is declared with professor who's teaching and credits) already assigned to current department then department can't be changed
    if asig_count>0 then
    raise docencias_adscritas;
    end if;
    --first delete our assignatura from list of assignaturas already assigned to current department in the corresponding ot_department
    delete from the (select d.asignaturas from departamento d where ref(d)=self.departamento) a
    where a.COLUMN_VALUE.codigo=self.codigo;
    --now assing (update) to current assignatura reference to the new department
    --self.departamento:=ref_departamento; <- THIS IS NOT WORKING HERE*, so the workaround is given below by using explicit UPDATE on the whole table
    update asignatura a set a.departamento=(select ref(d) from departamento d where d.codigo=n_departamento)
    where a.codigo=self.codigo;
    --what's left is to add current assignatura to the list of assignatures for new ot_departamento
    insert into the (select d.asignaturas from departamento d where d.codigo=n_departamento)
    select ref(a) from asignatura a where a.codigo=self.codigo;
    exception
    when no_data_found then
    raise_application_error(-20003,'No hay este departamaneto');
    when no_cambio then
    raise_application_error(-20002,'Asignatura ya adscrita a este departamento');
    when docencias_adscritas then
    raise_application_error(-20001,'Asignatura tiene docencias adscritas !!!');
    end cambio_departamento;
    end;
    I hope it's quite clear here. I'm still curious, why it's not working.
    Thanks,
    Wojtek

  • Explicit template member function call from return value of function

    i couldn't see this in the list of C++ standards not implemented <http://developers.sun.com/tools/cc/documentation/ss9_docs/mr/READMEs/c++.html> but sun studio 9 doesn't seem to allow explicit calls to template member functions where the left-hand-side is the return value of a function. here's a test-case:
    template <typename T> class Ptr {
    public:
      T* p_;
      Ptr(T* p) : p_(p) { }
      template <typename U> Ptr(const Ptr<U>& u) : p_(u.p_) { }
      template <typename U> Ptr<U> cast() const { return Ptr<U>(*this); }
    class A {
    class B : public A {
    Ptr<A> test_cast_1(const Ptr<B>& b) { return b.cast<A>(); }
    Ptr<A> test_cast_2(const Ptr<B>& b) { return Ptr<B>(b).cast<A>(); }sun studio 9 CC complains with the following message:
    "sunstudio9-template-explicit-call.cc", line 18: Error: Unexpected type name "A" encountered.
    "sunstudio9-template-explicit-call.cc", line 18: Error: Operand expected instead of ")".
    2 Error(s) detected.
    (line 18 is test_cast_2)
    is this a known bug?
    cheers,
    /lib

    you omitted the required keyword template:
    template <typename T> class Ptr {
    public:
      T* p_;
      Ptr(T* p) : p_(p) { }
      template <typename U> Ptr(const Ptr<U>& u) : p_(u.p_) { }
      template <typename U> Ptr<U> cast() const { return Ptr<U>(*this); }
    class A {
    class B : public A {
    Ptr<A> test_cast_1(const Ptr<B>& b) { return b.cast<A>(); }
    Ptr<A> test_cast_2(const Ptr<B>& b) { return Ptr<B>(b).template cast<A>(); }

  • How to add user defined functions in Menu bar of a Selection Screen?

    Hi,
    Can anybody please suggest me that how can I add user defined functions in the menu bar of a Selection Screen?
    Regards
    s@k

    Dear Amit,
    I am referring to the standard SAP program: RIEQUI20.
    On the initial screen, there are 3 tabs.
    Code:
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tab FOR 25 LINES.
    SELECTION-SCREEN TAB (20) tab1 USER-COMMAND ucomm1
                         DEFAULT SCREEN 001.
    SELECTION-SCREEN TAB (20) tab2 USER-COMMAND ucomm2
                         DEFAULT SCREEN 002.
    SELECTION-SCREEN TAB (20) tab3 USER-COMMAND ucomm2
                         DEFAULT SCREEN 003.
    SELECTION-SCREEN END OF BLOCK tab.
    AT SELECTION-SCREEN.
      CLEAR gv_okcode.
      gv_okcode = sy-ucomm.
      CLEAR sy-ucomm.
      CASE gv_okcode.
        WHEN 'IH08'.
          CALL TRANSACTION 'IH08'. "Equipment Selection
        WHEN 'IW29'.
          CALL TRANSACTION 'IW29'. "Notification Selection
        WHEN 'IW39'.
          CALL TRANSACTION 'IW39'. "Order List Selection
        WHEN OTHERS.
      ENDCASE.
    *   Check date:                                         
      IF NOT datuv IS INITIAL                            
      AND NOT datub IS INITIAL.                         
        IF datub >= datuv.                              
        ELSE.                                           
          MESSAGE e884(ih) WITH datuv datub.            
        ENDIF.                                           
      ENDIF.                                             
      IF variant IS INITIAL AND
         dy_vari IS INITIAL.
        PERFORM get_default_variant_f14 USING variant.
      ENDIF.
      PERFORM variant_existence_f14 USING variant.
      IF datuv IS INITIAL.
        datuv = sy-datum.
      ENDIF.
      IF datub IS INITIAL.
        datub = sy-datum.
      ENDIF.
      IF sy-ucomm = 'ADDR'.
        PERFORM adress_sel_f01 USING 'EQUIR'.
      ENDIF.
      PERFORM check_parnr_f76.
    *  AT SELECTION SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      STATICS: l_slset TYPE sy-slset.
    *--- Set initial variant
      PERFORM variant_init_f14 USING 'INST' 'INST' 'INST' 'RIEQUI20'.
      IF variant IS INITIAL AND
         dy_vari IS INITIAL AND
        gv_variant_flag IS INITIAL.
        PERFORM get_default_variant_f14 USING variant.
        gv_variant_flag = 'X'.
      ENDIF.
    *--- Set Icon for adress-button
      PERFORM set_icon_f01 USING dy_adrfl ad_icon text-ad0 text-ad1.
    *--- get classification data from select option
    *--- (if new variant or if called via submit or F3)
      IF ( l_slset NE sy-slset ) OR
         ( s_comw[] IS NOT INITIAL AND gt_clsd_comw[] IS INITIAL ).
        l_slset = sy-slset.
        gv_class_old = dy_class.
        gv_klart_old = dy_klart.
        PERFORM copy_selopt_comw_f79 TABLES gt_clsd_comw s_comw.
        PERFORM class_search_init_f77 USING 'EQUI'.
      ENDIF.
    *--- set Icon for classification
      LOOP AT gt_clsd_comw TRANSPORTING NO FIELDS          
                          WHERE atcod > '0'.               
        EXIT.                                              
      ENDLOOP.                                             
      IF sy-subrc IS INITIAL.
        gv_comw_flag = 'X'.
      ELSE.
        CLEAR gv_comw_flag.
      ENDIF.
      PERFORM set_icon_f01 USING gv_comw_flag cl_icon text-cl0 text-cl1.
      CALL METHOD cl_uid_cust=>selection_screen_output.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR variant.
      PERFORM variant_inputhelp_f14 USING variant 'RIEQUI20'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR dy_parnr.
      PERFORM f4_for_parnr_f76.
    AT SELECTION-SCREEN ON BLOCK clse.
      IF dy_class NE gv_class_old
        OR dy_klart NE gv_klart_old.
        gv_class_old = dy_class.
        gv_klart_old = dy_klart.
        CLEAR gv_comw_flag.
        REFRESH gt_clsd_comw.
        REFRESH s_comw.
      ENDIF.
      PERFORM class_exist_f77 USING dy_klart dy_class 'DY_CLASS'.
      IF sy-ucomm = 'COMW'.
        CALL FUNCTION 'IHCLSD_VALUATION_POPUP'
          EXPORTING
            i_klart               = dy_klart
            i_class               = dy_class
            i_language            = sy-langu
            i_key_date            = sy-datum
            i_also_subclasses     = dy_subcl
          TABLES
            ct_comw               = gt_clsd_comw
          EXCEPTIONS
            exc_no_class          = 1
            exc_klart_not_allowed = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    *--- fill classification data in select option
        PERFORM copy_comw_selopt_f79 TABLES gt_clsd_comw s_comw.
      ENDIF.
      IF sy-ucomm = 'ONLI'.
        sscrfields-ucomm = sy-ucomm.
      ENDIF.
    Regards
    s@k
    Edited by: siemens.a.k on Jan 15, 2010 10:10 AM

  • Calling a Member Function from within a Cursor in a Procedure

    Hello Folks
    I'm a newbie to oracle and am in the process of learning 10G. My question is:
    I created a type called row_po and defined a member function getCost() which returns the total cost of the order with line items as nested table, which i intend to call from within a procedure. In the procedure my SELECT returns multiple records and hence I need to use a cursor. For each record I've got to display the order_no, qty and order_cost (qty and order_cost are part of a line items nested table). I'm able to get to the order_no and qty but don't know how to call the member function to get the order_cost. Here's my procedure:
    CREATE OR REPLACE PROCEDURE get_podet(part_num in number)
    AS
    CURSOR c2 is
    SELECT *
    FROM tab_po po, TABLE (po.LineItemList_nestab) L
    WHERE L.PartNo = part_num;
    BEGIN
    FOR crec in c2 LOOP
    DBMS_OUTPUT.PUT_LINE('ORDER NUMBER: ' || crec.PONo);
    DBMS_OUTPUT.PUT_LINE('LINE QTY: ' || crec.Qty);
    {color:#ff0000}*DBMS_OUTPUT.PUT_LINE('ORDER VALUE: ' || ''); -- order_cost which should be returned from the member function i've mentioned --*
    {color}END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Failed' || 'SQLCODE: ' || SQLCODE);
    DBMS_OUTPUT.PUT_LINE('SQL ERROR MESSAGE ' || SQLERRM);
    END;
    The line in red is where i want to call my function getCost() which is a member of tab_po po as mentioned in my SELECT.
    Any thoughts highly appreciated.
    Thanks and Regards

    One way would be to just run the query in a editor (sqlplus or toad) and see whats the column name.
    Before that can you show us the structure of the type.
    If you declare a table type without an object then the default column name is COLUMN_VALUE else the object filed name is taken.
    Example without object in table type.
    SQL> create or replace type tbl as table of integer
      2  /
    Type created.
    SQL> create or replace function fn return tbl
      2  as
      3     ltbl tbl;
      4  begin
      5     select level bulk collect into ltbl
      6       from dual
      7    connect by level <= 10;
      8
      9     return ltbl;
    10  end;
    11  /
    Function created.
    SQL> select * from table(fn)
      2  /
    COLUMN_VALUE
               1
               2
               3
               4
               5
               6
               7
               8
               9
              10
    10 rows selected.
    Example with object in table type.
    SQL> create or replace type obj as object(no integer)
      2  /
    Type created.
    SQL> create or replace type tbl as table of obj
      2  /
    Type created.
    SQL> edit
    Wrote file afiedt.buf
      1  create or replace function fn return tbl
      2  as
      3     ltbl tbl;
      4  begin
      5     select obj(level) bulk collect into ltbl
      6       from dual
      7    connect by level <= 10;
      8     return ltbl;
      9* end;
    10  /
    Function created.
    SQL> select * from table(fn)
      2  /
            NO
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.Edited by: Karthick_Arp on Jan 13, 2009 5:00 AM

  • Object view  with nested table and member functions????????????????

    HI frds:)
    I need some help regarding writeing soem queries..
    I have to use view in retreving data and by useing member functions of object.
    1) i have to create a nested table by useing type object.
    2) i have to create a object wtih member functions inorder to create view of taht nested table,.
    3) by useing this objectt view and by useing methods i have to write soem queries ...
    If any one know or any information regarding this please reply me... as i have searched in net alot but i was unable to figure out..
    Thanks....

    // first createing object
    create type emp_det as object
    (empname varcahr2(20),start_date date,end_date date);
    // creating table of that object
    create table emp_detai_table as table of emp_det;
    // creating nested table
    create table empl (emp_no number,emp_detail emp_detail_table,dep_no number)nested table emp_detail store as s;
    //now i want to create view.. inorder to create view i need to create object. in that object i want to create methods.. these methods should work with date attributes..
    after creating object view i need to select or write some queries by useing member methods..
    This is the tast i have to perform.,. i have no materials ...if u have any link ..forward me..
    i have to do it as soon as possible..
    waiting for your reply...

  • Hyperion Planning search member function error

    Hi,
    We have a Oracle EPM 11.1.1.3 64 bit implementation on windows 2003 R2 servers. Users are authenticated externally through shared services. For only one user the planning search member function doesn't work correctly.
    When the user clicks on the search member function in a data form, he gets redirected to the login page.
    Please note that this just happens for only one user irrespective of the machine from where he logs on. For all other 500 or so users the search function works fine.
    Thanks in advance!!!

    Can this user drill into this dimension using SmartView/Classic add-in?
    IOW, is this a weird security issue that only manifests itself in POV dropdowns, or does the security work when trying to retrieve when in rows.
    If you create another username with the same security, does it behave the same way?
    Just wondering how weird, weird is.
    Regards,
    Cameron Lackpour

  • Use CustomFunctionController to add Repository Custom Function to a reportclientdocument

    <p class="ssiBODYCOPY">I would love to know how to add a Repository Custom Function to a reportclientdocument - If this is possible?<br />I need to know how to instantiate an object of type Custom Function from the enterprise repository or get a list of available custom functions. <br />The following code takes a "custom function object" from an existing report (which is a repository custom function) and I THINK adds it to the reportclientdocument - in fact the count of items in the customfunctioncontroller is 1 after I add the custom function but when I save the reportclientdocument they dissapear - I am not sure if I should be using ADD or INSERT method. I also was able use other controllers such as the DataDefController which works sucessfully. Please can someone help me figure out how to do this (btw where in CI_INFOOBJECTS is a custom function stored?)<br /><br />Thanks Nicole<br /><br />Dim rptClientDoc As ReportClientDocument<br />&#39;open the report<br />rptClientDoc = OpenReport("report1", ceInfoStore)<br /><br />Dim myCustomfunctions2 As CrystalDecisions.ReportAppServer.DataDefModel.CustomFunctions<br />Dim myCustomcontroller2 As CrystalDecisions.ReportAppServer.Controllers.CustomFunctionController<br />myCustomcontroller2 = rptClientDoc.CustomFunctionController()<br /><br />myCustomfunctions2 = myCustomcontroller2.GetCustomFunctions()<br />Dim cf As CustomFunction<br />cf = getfunction(ceInfoStore, ceSession) &#39; Gets valid custom function object in ANOTHER report<br />myCustomfunctions2.Add(cf)<br /><br /><br />Dim datacont As CrystalDecisions.ReportAppServer.Controllers.DataDefController<br />datacont = rptClientDoc.DataDefController<br />datacont.RecordFilterController.SetFormulaText("currentdate > month(testing)")<br /><br />SaveNewReport(ceInfoStore, rptClientDoc, "report1", "report2")</p>

    Hello Nicole
    please also use our diamond sample site to search for samples which might solve your problem.
    Your need would be in CE managed samples which we publish for JAVA and NET.
    Please use this link:
    https://boc.sdn.sap.com/
    Falk

  • Need a user exit to add custom partner function in sales order @ item level

    Hi,
    Need a user exit to add custom partner function in sales order at item level. Goto --> Item --> Partner.
    Thanks,
    Thiyagi

    HI Leo
      To add a condition price for a condition type, this has to be assigned in the <b>pricing procedure</b>. For each condition type in a pricing procedure, we will have <b>access sequences</b>. If we follow this approch, the price is automatically extracted basing on the access sequences when condition records are maintained. For this, no coding is required and everything can be done by configuration by Functional consultant.
       Naren is right to point out on the same.
      If you need to change the price for a particular condition which already exists, you can go by <b>pricing routines</b>. Go through transaction <b>VOFM</b> for the same. 
       I advice you to discuss with your functional consultant and understand the requirement and then go for modifying accordingly.
    Kind Regards
    Eswar

  • Making all named member functions of an actionscript class avlbl to ExternalInterface automatically

    Making all named member functions of an actionscript class available to ExternalInterface automatically :
    I am trying to custom-tweak the as3 compiler to generate instructions to register all functions in the ClassDefinitionNode to ExternalInterface.
    I guess the operation will have to be performed somwhere between the analyze sequences of the compiler, but am not quite able locate where.
    I have this codelet (executed for all constructors, for every non-constructor)
                    ArgumentListNode argListNode = new ArgumentListNode(
                            new LiteralStringNode(
                                    NodeMagic.getClassName(clNode)+ "." + functionCommonNode.identifier.name), 0);
                    //argListNode.items.add(new LiteralNullNode());
                    argListNode.items.add(new IdentifierNode(functionCommonNode.identifier.name, 0));
                    MemberExpressionNode mnode = new MemberExpressionNode(new IdentifierNode("ExternalInterface", 0),
                            new InvokeNode("addCallback",
                                    argListNode),0);
                    mnode.ref = new ReferenceValue(cx, null, "ExternalInterface", ObjectValue.intrinsicNamespace); //NOT TOO SURE ABOUT THIS ONE
                    constructor.body.items.add(mnode
    Any assistance would be appreciated!
    Thanks!

    Making all named member functions of an actionscript class available to ExternalInterface automatically :
    I am trying to custom-tweak the as3 compiler to generate instructions to register all functions in the ClassDefinitionNode to ExternalInterface.
    I guess the operation will have to be performed somwhere between the analyze sequences of the compiler, but am not quite able locate where.
    I have this codelet (executed for all constructors, for every non-constructor)
                    ArgumentListNode argListNode = new ArgumentListNode(
                            new LiteralStringNode(
                                    NodeMagic.getClassName(clNode)+ "." + functionCommonNode.identifier.name), 0);
                    //argListNode.items.add(new LiteralNullNode());
                    argListNode.items.add(new IdentifierNode(functionCommonNode.identifier.name, 0));
                    MemberExpressionNode mnode = new MemberExpressionNode(new IdentifierNode("ExternalInterface", 0),
                            new InvokeNode("addCallback",
                                    argListNode),0);
                    mnode.ref = new ReferenceValue(cx, null, "ExternalInterface", ObjectValue.intrinsicNamespace); //NOT TOO SURE ABOUT THIS ONE
                    constructor.body.items.add(mnode
    Any assistance would be appreciated!
    Thanks!

Maybe you are looking for

  • HT1923 my ipod is not seen by itunes

    My ipod touch is not being seen by itunes when i connect it to my laptop. It was fine a couple fo weeks ago. I have uninstalled and reinstalled but it still wont do anything

  • RMAN-00558: error encountered while parsing input commands

    Hi, on 12C on Win 2008 as said in documentation : @ (at sign) Example 2-2 Running a Command File Within RMAN This example shows how you can execute a command file from the RMAN prompt and from within a RUN command. User-entered text appears in bold.

  • High pitched sound (not from the speakers)

    I bough an A665 on may 21st 2011, and since day 1 ive been hearing a high pitched sound coming from the underside of the laptop (directly above the RAM slots). Sometimes its there and sometimes its not (mostly it is...). I found out that if i scroll

  • CS6 Master Collection asking for password after months of use

    Why is CS6 now asking for a password again after months of use?  I have already entered a valid passwork upon installation.  I am running Mountain Lion on a 15" Macbook Pro.  I launch Photoshop, and then I get this screen But I already have a passwor

  • Help about WAAS SSL optimized policy

    hi everyone I enable SSL optimized function and it work fine but I have a question in my environment, most SSL tcp session size is under 10 KB so when small size tcp session optimized by waas it's optimized bytes is bigger than original byte so, does