Select object member function problem

I use RDBMS 10.2.0.1.0
SQL> CREATE OR REPLACE TYPE foo AS OBJECT
2 (
3 dummy NUMBER,
4 MEMBER FUNCTION to_str RETURN VARCHAR2,
5 PRAGMA RESTRICT_REFERENCES(to_str, WNDS)
6 );
7 /
Type created
SQL>
SQL> CREATE OR REPLACE TYPE BODY foo
2 IS
3 MEMBER FUNCTION to_str RETURN VARCHAR2
4 IS
5 BEGIN
6 RETURN 'test';
7 END;
8 END;
9 /
Type body created
SQL>
SQL> CREATE TABLE test_foo
2 (foo_field foo);
Table created
SQL>
SQL> INSERT INTO test_foo
2 VALUES (foo(1));
1 row inserted
SQL> select * from test_foo;
FOO_FIELD
<Object>
SQL> SELECT foo_field.to_str FROM test_foo;
SELECT foo_field.to_str FROM test_foo
ORA-00904: "FOO_FIELD"."TO_STR": invalid identifier
Where is a problem? What's wrong?

SELECT t.foo_field.to_str() FROM test_foo t;Best regards
Maxim

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

  • 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...

  • Oracle8i Object-Relational Features Problem(How to manipulate value by Member Method)

    sorry ~ I've never use 8iLite before, but I really want to figure out this !
    How can I create a Object Table , define Member Functions to change it's self
    attribute value ~
    for example :
    CREATE OR REPLACE TYPE HumanType AUTHID CURRENT_USER AS OBJECT (
    id NUMBER(3,0),
    name VARCHAR(4),
    age NUMBER(3,0),
    MEMBER FUNCTION getName RETURN VARCHAR2,
    MEMBER Procedure ageChange(c_age IN NUMBER)
    CREATE OR REPLACE TYPE BODY HumanType AS
    MEMBER FUNCTION getName RETURN VARCHAR2 IS
    BEGIN
    RETURN (SELF.name);
    END;
    MEMBER PROCEDURE ageChange(c_age IN NUMBER) IS
    age NUMBER;
    BEGIN
    age:=age+c_age;
    END;
    END;
    CREATE TABLE MAN OF HumanType;
    There is one record in MAN table.
    ID NAME AGE
    1 VIC 21
    in SQLplus I command
    SQL> SELECT m.agechange(5) FROM MAN m WHERE ID=1;
    THE ERROR MESSAGE IS :
    ERROR AT LINE1;
    ORA-06553: PLS-222: no function with name 'AGECHANGE' exists in this scope
    Q1.WHY CAN'T I USE the Member Method to Change the Value of itself ?
    Q2.Is there any other site can discuss Oracle Object-Relational Feature ?
    Thank you very much!

    hi,
    u r trying to return values but u r using procedure. that's first mistake
    then u declared variable called age in proc. from where does the age value comes. do u assume it will take column value. if so its wrong.
    start trying with simple examples
    ex: CREATE OR REPLACE TYPE HumanType AS OBJECT (
    id NUMBER(3,0),
    name VARCHAR(4),
    age NUMBER(3,0),
    MEMBER FUNCTION ageChange(c_age IN NUMBER) RETURN NUMBER
    CREATE OR REPLACE TYPE BODY HumanType AS
    MEMBER FUNCTION ageChange(c_age IN NUMBER) RETURN NUMBER IS
    age NUMBER;
    BEGIN
    age:=age+c_age;
    RETURN AGE;
    END;
    END;
    now try with ur sql stt
    since there is no value for variable age it will be treated as null and the result will be : null. it won't give error
    try this.
    if u have oracle 8 complete reference book refer pages 628 to 630.
    ie. Methods, creating metods.

  • Service template problem - Unable to perform the job because one or more of the selected objects are locked by another job - ID 2606

    Hello,
    I’ve finally managed to deploy my first guest cluster with a shared VHDX using a service template. 
    So, I now want to try and update my service template.  However, whenever I try to do anything with it, in the services section, I receive the error:
    Unable to perform the job because one or more of the selected objects are locked by another job.  To find out which job is locking the object, in the jobs view, group by status, and find the running or cancelling job for the object.  ID 2606
    Well I tried that and there doesn’t seem to be a job locking the object.  Both the cluster nodes appear to be up and running, and I can’t see a problem with it at all.  I tried running the following query in SQL:
    SELECT * FROM [VirtualManagerDB].[dbo].[tbl_VMM_Lock] where TaskID='Task_GUID'
    but all this gives me is an error that says - conversion failed when converting from a character string to uniqueidentifier msg 8169, level 16, State 2, Line 1
    I'm no SQL expert as you can probably tell, but I'd prefer not to deploy another service template in case this issue occurs again.
    Can anyone help?

    No one else had this?

  • 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.

  • 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>

  • Pass C++ Class Member Function as a callable function in AIR Native Extension

    I'm writing an ANE and I'd like to know if anyone has been able to pass a C++ class member function pointer as a callable function from AIR? I have tried this so far with a little bit of C++11 trickery and it's crashing. I've also statically linked the libstdc++ into my library, according to the documentation, in order to ensure that these features I use work correctly. I have code like so:
    FakeWorld* world = new FakeWorld();
    *numFunctions = 1;
    memberFunctions = (FRENamedFunction*) malloc(sizeof(FRENamedFunction) * (*numFunctions));
    ANEMemberFunction mCreateFakeBody = std::tr1::bind(&FakeWorld::createFakeBody, world, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4);
    ANEFunction* createFakeBody = mCreateFakeBody.target<ANEFunction>();
    memberFunctions[0].name = (const uint8_t*) "createFakeBody";
    memberFunctions[0].functionData = NULL;
    memberFunctions[0].function = createFakeBody;
    FRESetContextNativeData(ctx, (void*)world);
    I just realized I'm using C here for allocating the member functions array.. silly me, but I don't think this is the cause of my issue. I refuse to believe that Adobe has built to the Native Extensions portion of the runtime in such a way that I have to cram every single function I want to create (natively) into a global, C formatted namespace (Especially since the documentation says that C is only required for the extenion and context initializing function interfacing and the rest of the code can be done in C++ or objective-C). So please let me know if and how this is possible and I thank you so much in advance for your time!P.
    P.S. Currently when I run this code, I can do the object initialization just fine. As soon as I invoke the "createFakeBody" method on the native side, the runtime dies and simply says:
    Problem signature:
      Problem Event Name: BEX
      Application Name: adl.exe
      Application Version: 3.1.0.4880
      Application Timestamp: 4eb7612e
      Fault Module Name: StackHash_0a9e
      Fault Module Version: 0.0.0.0
      Fault Module Timestamp: 00000000
      Exception Offset: 00000000
      Exception Code: c0000005
      Exception Data: 00000008
      OS Version: 6.1.7601.2.1.0.256.48
      Locale ID: 1033
      Additional Information 1: 0a9e
      Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
      Additional Information 3: 0a9e
      Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt
    Thanks again for your assitance.

    It's been a little while since i've dealt with C++ and not up to speed on tr1 or C++0x, so forgive me if i'm not helping.
    The the examples of std::tr1::bind that i'm seeing out there seem to be either dereferencing the bound 'this' pointer when creating the bound method, i.e. in your case *world instead of world, or using std::tr1::ref(*world), therefore i believe that bind expects the bound parameters to be passed by reference.
    Given that the result of std::tr1::bind is callable (basing that on http://stackoverflow.com/questions/3678884/virtual-member-functions-and-stdtr1function-how -does-this-work) could you simplify to the following:
    memberFunctions[0].name = (const uint8_t*) "createFakeBody";
    memberFunctions[0].functionData = NULL;
    memberFunctions[0].function = std::tr1::bind(&FakeWorld::createFakeBody, *world, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4);
    Or for an even simpler starting point, creating a test member function 'helloWorld' in FakeWorld that takes no arguments and using:
    memberFunctions[0].name = (const uint8_t*) "helloWorld";
    memberFunctions[0].functionData = NULL;
    memberFunctions[0].function = std::tr1::bind(&FakeWorld::helloWorld, *world);
    Hope this helps.

  • GetVariable() doesn't work in FireFox for object member variables

    I'm trying to access Flash member variables from Javascript
    using GetVariable. The following line of code works for IE but not
    for Firefox:
    var variable = swf.GetVariable("someObject.someProperty");
    In IE, the GetVariable() function returns the correct value
    for the property. However in Firefox, the GetVariable() function
    returns "null" when trying to access the property. If I just try to
    access the object in Firefox (i.e. swf.GetVariable("someObject"), I
    get a string back (instead of the object that I am expecting). If I
    try to access a variable (such as a string) and not an object using
    GetVariable(), this works in both Firefox and IE.
    Any ideas what I am doing wrong? I suspect that my syntax for
    accessing object member variables in Firefox is incorrect but I
    have not been able to find any documentation on the correct syntax.
    Any assistance would be greatly appreciated.
    Thanks.

    Thanks, but this isn't an issue.
    The window.document.flashMovie will return the correct flash
    object/embed flash movie.
    The issue is that the GetVariable method wont return the
    object variable. When you try to get an simple variable that is in
    the _root timeline, it will return the value. Example:
    movie.GetVariable(_url) will return the url of the flash
    movie without any problem.
    But when you create an ActionScript class with
    userName property and then you will create the instance of
    it in the _root, you should be able to get it's value. Example:
    Flash:
    var obj = new SomeClass();
    obj.userName = "peter";
    JavaScript:
    movie.GetVariable("/obj:userName");
    or
    movie.GetVariable("obj.userName");
    This will return
    Peter for IE and null for Forefox/Opera.
    The same when you use the document.embeds[..].

  • Help too selecting object [JS]

    Hi there
    I am problems selecting an object by it id or label. In my script a list items on on page and if the text are using ParagraphStyleName "Itembox 9" i save it in array.
    But how do i select the object by id or label ?
    I have to do this to make changes on the object later.
    Does anyone know about good books on indesign scripting  with javascript ?
    Regards
    TT.
    test()
    function test(){
    var myDocument = app.documents.item(0);
    var myElement = myDocument.pages.item(0).pageItems;
    var myObjectsToSelect = new Array;
    for(myItemCounter = 0; myItemCounter < myElement.length; myItemCounter ++){
          var myElementID = myElement[myItemCounter].id;
       try {
        var myTextParagraphStyleName = myElement[myItemCounter].parentStory.appliedParagraphStyle.name;
           if(myTextParagraphStyleName == "item_box_9"){
               $.writeln("Element Id ", myElementID);
              var myTextContents = myElement[myItemCounter].contents;
             $.writeln("Text  ", myTextContents);
             myObjectsToSelect.push(myElementID);
          catch (Error) {
    // error

    In contrast with the interface, in scripting you rarely need to select objects in order to do something with them. You collect certain text frames in your array myObjectsToSelect. If e.g. you want to move them, you'd do something like this:
    for (i = 0; i < myObjectsToSelect.length; i++)
        myObjectsToSelect[i].move (...);
    What do you want to do with them?
    Peter

  • 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

  • Reference to Class Member Functions

    Hello all.
    I have a question about references to LV class member functions. I have a small example to demonstrate my problem.
    My test class Base implements a reentrant public dynamic dispatch member function, doSomething.vi. 
    Another test class, Child, inherits Base and overrides the implementation of doSomething.vi.
    Now say I have an array of Base objects (which could include any objects from classes that inherit Base). I want to run the doSomething methods for all the objects in the array in parallel.
    In C++, I'd define a pointer to the virtual member function doSomething, and use it with each object in the array and the correct version of doSomething would be called.
    In Labview, the only way I've found to do it is like this:
    This is less than ideal, because it relies on every child class implementing doSomething, and relies on specific names for the inputs to the method. 
    Is there a better way to do this?
    Thank you,
    Zola

    I still suspect you are over-working this code and not leting LVOOP do tis thing.
    As I understand it you want to creae an active object but detemine its class at run time. The recent Architect summit touched on messaging for what they are calling a "worker Pool" pattern or what-not. YOu may want to search on the summit stuff. lacking that I'll share some images of where I did something similar ( I think). Note this is an older app and new stuff like the "Start Asyncronous call..." has been introduced making this even easier.
    I want to create a new Active Object (thread running in the background) so I invoke a method to do so
    It invokes the following that create some queues for talking to it and getting info back.
    Time does not permit me doing a complete write-up but I have assembled the above images into a LVOOP Albumn found here.
    When you click on one of those images you will get a large view as shown in this example.
    Just below that image you will find a link to the original thread where I posted the image and talked about it.
    I believe the best I can do for you at the moment is to urge you to browse my albumn and chase the links.
    That agllery was assembled in an attmept to help you and other before you asked. I hope it is helpful.
    Ben 
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • [SOLVED] Passing a non-static member function as a function pointer

    I need to pass a function pointer to a public method to a system call, nftw() to be precise.
    I know that member functions don't match the required signature because of the hidden 'this' pointer, but
    the only way to work around that is by using a small wrapper function that makes use of a global variable (the object of which I want to call the method).
    Speaking in code, this is the way I've solved the problem currently:
    // create a global variable here
    static MyObject obj;
    static int myObject_method_wrapper(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf) {
    return obj.handleDirEntry(fpath, sb, tflag, ftwbuf);
    // somewhere in main()
    nftw(walkroot, myObject_method_wrapper, 20, FTW_PHYS);
    Now, my question: Can't this be done without a global instance of MyObject? It is pointed out here that other ways are existent, but sadly they are not mentioned.
    Glad if someone could help me out!
    Last edited by n0stradamus (2012-04-24 22:59:47)

    I think you are stuck:
    1. You are not in control of the interface (of nftw), and furthermore,
    2. You are not in control of any of the parameters sent to the callback.
    nftw has no idea which one of your objects it is supposed to reference, and
    there's no apparent way to tell it.
    But given this situation, are you sure it makes sense to use a non-static
    member?  It seems kind of strange to me-- any instance-specific data is
    necessarily going to be independent of the function calls!  So even if you
    engineer something to avoid using a global, whatever you engineer is still
    going to involve some *arbitrary* instance of your class (e.g. peterb's
    solution, which uses the most recently created instance).  The arbitrary-ness
    doesn't feel right, since it sort of implicitly says that none of the instance
    data is important.  No important instance-specific data sounds like static...

  • It is possible select a member "field" editable/moveable with mouse?

    I have diferent editable "field" on the stage.
    If the "field" are only "editable" I can select every field with the mouse and write inside of it, but if I make them "editable/moveable" I can't select with the mouse any field but I can pass from one to other only with the key "TAB".
    Do you know if there is a way to select every "Member field" that I want with mouse and without "Tab" when every field is set to editable/moveable?
    Thank.

    Still not sure about your intention, but maybe:
    SQL> create or replace type test_obj as object
                      (s_name varchar2 (30),
                       member function test
                          return varchar2)
    Type created.
    SQL> create or replace type body test_obj
    as
       member function test
          return varchar2
       is
          loc_name       varchar2 (30);
          t_obj test_obj;
       begin
          execute immediate 'select test_obj(''' ||s_name||''') from dual'  into t_obj;        -- is it somehow possible to use s_name here - without using clause
          return t_obj.s_name;
       end;
    end;
    Type body created.
    SQL> declare
       o_test         test_obj := test_obj ('testText');
    begin
       dbms_output.put_line ('s_name: ' || o_test.test);
    end;
    s_name: testText
    PL/SQL procedure successfully completed.

  • 'select objects: click and drag to select several objects' doesn't work

    I have recently upgraded to Office 2010, and have the same problem as
    http://social.technet.microsoft.com/Forums/en-US/office2010/thread/75270638-e02b-4a78-b291-043abbca04ae?prof=required
    When I use Select - Select Objects in the Editing part of the ribbon to select multiple drawing shapes, it no longer works like in office 2007. I can't drag a rectangle in the document to select objects within an area.
    I would have guessed this is the same problem as the link I refer to, but I'm not running the beta version of 2010. It seems not to be solved.
    Anything I can do to fix this?

    I have just registered so I could reply to this thread.
    The registration process was very ... aehm ... frustrating, I was only able to fill in the correct Captcha after about 10 ties. But ... this is not unexpected, when working with a Microsfoft product. How am I supposed to know whether that bloody captcha
    wants me to to write '4Yp8' or '4yP8'. There is no way to tell. You can distinguish capital letters when it is something like A, a or H, h, but not between y and Y or P and p.
    I would like to thank all the posters for suggested workarounds. They work. Kinda - sorta ... . I was able to finish the editing of large picture (consisting of many graphics objects) that HAS to be made in word (My boss said so). All your tips saved
    me *hours* of frustration.
    I would like to tell Microsoft programmers AND their managers, that *if* the quote in the second post is correct: 
    ================
    The work needed to make the object selection work as it did in Word 2007 was out of scope for this release. It's not as
    simple as using the same feature that existed in the last version since we upgrading our graphics/art features; the way the shapes/objects need to be selected is different than how "old" graphics/art is selectable in Word 2007.
    That said, the "select object" tool that exists in Word 2010 should allow you to select individual shapes. You can select
    multiple shapes holding down the CTRL or SHIFT key while clicking shapes. You might ask how this is different than selecting shapes without turning on "select objects"; the answer to that would be to allow you to select shapes that are "behind" text, or more
    easily select rotated shapes, etc.
    ================
    You are bunch of incompetent amateurs. 
    If I used such lame excuse for missing important functionality at work, I would be very soon replaced by a more competent programmer.
    This time I am not a programmer, I am AN USER. And, as an user I do not care if your internal data structure for new objects doesn't let you do something easily. Find a way to implement that feature or change the data structure. Period.

Maybe you are looking for

  • Is there a way to transfer software from one computer to another?

    When I first bought Photoshop, I downloaded the software to my laptop, which is no longer working. I want to transfer it to my desktop. I do not have the disk any more. How would I go about doing this?

  • Transfer ongoing call to a third part is not working

    Merge calls and conference call are working fine, but there is no function for transfer call to another person. And that function is crucial to me as I planned to use the Iphone as a work phone. When will Apple release an update that will fix this pr

  • Problems with Late 2011 MBP (catalog corrupt, won't boot from USB/CD)

    Hello, I have had some problems with my Late 2011 MBP running OSX 10.8.x (latest update) I was using Safari when suddenly my screen froze. It has happened a couple of times before but it usually is either: 1.) a black screen for 5 seconds while nothi

  • External table error in windows environment

    Can i create external table from directory which is on network drive not on local server where oracle is intsalled. I am receiving follwoing error when I try to query external table poinittng to directory object on network drive in windows. Thanks ER

  • Expand or stretch HDTV

      Sometimes pressing the HD Zoom button on my remote will Zoom, Expand, or Stretch the screen on my Samsung HDTV. Sometimes it will not!  Changing the settings for my TV has no effect. 1080,720.480 does not matter. Thursday night I could Zoom the TV