Type of legacy objects, dynamic storage safe?

Hello

I'm trying to store objects of mixed type inherited from a common base class in a way that preserves the original type.

I tried with globals functional attributes, with labview globals, all without success. Whenever I read about a stored object, it degrades to the base class.

A project that should illustrate the behavior is attached.

-class "device of Base' base with screws on members 'Init', 'Read', 'Write' (intended to serve as an interface)

-"GPIB", "TCP", "DAQmx" derived classes

All required start-up designed (according to the test script) are created and stored in the Device Manager. Device Manager is a global functional, containing a Variant that manages a list of 'DeviceId => 'Device Base' object' assignments.

Storage and playback to and from the job manager, at least until the borders of VI are available. In VI, the correct type of origin (for example "GPIB device") is returned. Outside the VI, the type is cast in the "Base Unit" and the bad member of a dynamic forwarding VI gets called (basic implementation)

How can I safely dynamically store and read mixed objects from the same base class without losing the concrete type?


Tags: NI Software

Similar Questions

  • ' Gets an attribute xsi: type with XMLType object relational storage.

    Hello


    How to recover the attribute xsi: type, when you use storage relational XMLType object.

    When you have for example a ProductOrder object type and one object type MoveOrder what a CustomerOrder extensions type how to recover if the CustomerOrder is a kind of MoveOrder or ProductOrder attribute:

    < ns2:customerOrder xsi: type = "ns3:UpcProductOrder" >


    I would use the XMLTable service in combination with the XPath rewrite.

    version of the database 11.2.0.2

    Thanks for the details.

    As I said in my first answer, the prefix xsi is predefined, don't try to redeclare him.

    I know that sounds strange and is in contradiction with what the manual, but it seems to work that way with the storage of GOLD.

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb_xquery.htm#CBAJBDFA

    You can use these prefixes in XQuery expressions without first declaring in the prologue of the XQuery expression. You can redefine any of them except xml in the prologue.

    If documentation bug or implementation bug? I do not know.

    In any case:

    SQL> BEGIN
      2    DBMS_XMLSCHEMA.registerSchema(
      3      SCHEMAURL => 'test_otn.xsd',
      4      SCHEMADOC => bfilename('TEST_DIR','test_otn.xsd'),
      5      CSID => nls_charset_id('AL32UTF8')
      6    );
      7  END;
      8  /
    
    PL/SQL procedure successfully completed
    
    SQL>
    SQL> insert into cust_order values (xmltype
      2  ('
      3  
      6  a
      7  b
      8  '));
    
    1 row inserted
    
    SQL>
    SQL> SELECT order_id
      2       , order_item
      3       , order_type
      4  FROM cust_order
      5     , XMLTABLE (
      6         XMLNamespaces ('http://bla.com' as "ns1")
      7       , '/ns1:customerOrder'
      8         passing object_value
      9         columns order_id   varchar2(20) path 'ns1:orderId'
     10               , order_item varchar2(20) path 'ns1:orderItem'
     11               , order_type varchar2(30) path '@xsi:type'
     12       ) ;
    
    ORDER_ID             ORDER_ITEM           ORDER_TYPE
    -------------------- -------------------- ------------------------------
    a                    b                    http://bla.com:ProductOrder
     
    

    And if you do want the local name:

    SQL> SELECT order_id
      2       , order_item
      3       , order_type
      4  FROM cust_order
      5     , XMLTABLE (
      6         XMLNamespaces ('http://bla.com' as "ns1")
      7       , '/ns1:customerOrder'
      8         passing object_value
      9         columns order_id   varchar2(20) path 'ns1:orderId'
     10               , order_item varchar2(20) path 'ns1:orderItem'
     11               , order_type varchar2(30) path 'local-name-from-QName(@xsi:type)'
     12       ) ;
    
    ORDER_ID             ORDER_ITEM           ORDER_TYPE
    -------------------- -------------------- ------------------------------
    a                    b                    ProductOrder
     
    

    Hope that helps.

  • How to upgrade to a nested Table of Types of legacy objects?

    Anyone know why the (commented) next line does not work and what I can do? Is it possible to mount the column I'm trying to update? I think I'm going crazy...

    create or replace type person_ot as an object (the varchar2 (10)) no final name.
    /

    create or replace type student_ot under person_ot (number s_num) not final;
    /

    Create type person_tt as table of the person_ot;
    /

    declare
    lv_person_list person_tt;
    lv_sql varchar2 (1000);
    ref_cur sys_refcursor;
    Start
    lv_sql: = ' select new student_ot ('fred', 100) double
    Union of all the
    Select new student_ot ("sally", 200) of the double ';
    --
    Open the ref_cur for lv_sql;
    collect the fetch ref_cur in bulk in lv_person_list;
    close ref_cur;
    --
    dbms_output.put_line (lv_person_list. (Count);
    for me in lv_person_list.first... loop of lv_person_list. Last
    lv_person_list (i) .name: = initcap (lv_person_list (i) .name); -It works!
    lv_person_list (i) .s_num: = 9999;  Why this line does not work and how do I update the s_num column? :-(
    end loop;
    end;
    /

    As default lv_person_list (i) is treated as person_ot object do not type student_ot. You must use a combination of a temporary object of type student_ot and TREAT the function:

    declare
    lv_person_list person_tt;
    lv_sql varchar2(1000);
    ref_cur sys_refcursor;
    tmp student_ot;
    begin
    lv_sql:= 'select new student_ot(''fred'', 100) from dual
    union all
    select new student_ot(''sally'', 200) from dual';
    --
    open ref_cur for lv_sql;
    fetch ref_cur bulk collect into lv_person_list;
    close ref_cur;
    --
    dbms_output.put_line(lv_person_list.count);
    for i in lv_person_list.first..lv_person_list.last loop
    lv_person_list(i).name := initcap(lv_person_list(i).name ); -- This works!
    tmp := treat(lv_person_list(i) as student_ot);
    tmp.s_num := 9999;
    lv_person_list(i) := tmp;
    end loop;
    end;
    /
    2
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • ProcessEntry (...) consistency: unknown user type: java.lang.Object

    Hello!

    I created a new class that extends the VersionedPutAll class. When I replace processEntry (...) method I get an exception:
    Exception in thread "main" (Wrapped: Failed request execution for DistributedCache service on Member(Id=1, Timestamp=2012-08-09 18:02:13.598, Address=192.168.1.1:8088, MachineId=49553, 
    Location=site:,machine:StBook,process:18387, Role=IntellijRtExecutionAppMain) (Wrapped) unknown user type: java.lang.Object) java.io.IOException: unknown user type: java.lang.Object
    The original VersionedPutAll works well. My class without processEntry (...) works well also. But the simple substitution of processEntry (...) as
    protected Object processEntry(InvocableMap.Entry entry, Map mapAll, boolean fInsert, boolean fReturn) {
        return new Object();
    }
    throws an exception.

    Does anyone know what is the problem? Thank you.

    public class ExtVersionedPutAll extends VersionedPutAll {
        private static final Object NO_RESULT = new Object();
    
        public ExtVersionedPutAll() {}
    
        public ExtVersionedPutAll(Map map) {
            super(map);
        }
    
        public ExtVersionedPutAll(Map map, boolean fAllowInsert, boolean fReturn) {
            super(map, fAllowInsert, fReturn);
        }
    
        protected Object processEntry(InvocableMap.Entry entry, Map mapAll, boolean fInsert, boolean fReturn) {
            Object oKey = entry.getKey();
            if(mapAll.containsKey(oKey)) {
                Versionable oValueCur = (Versionable)entry.getValue();
                Versionable oValueNew = (Versionable)mapAll.get(oKey);
                boolean fMatch;
                if(oValueCur == null) {
                    fMatch = fInsert;
                } else {
                    Comparable verCur = oValueCur.getVersionIndicator();
                    Comparable verNew = oValueNew.getVersionIndicator();
                    fMatch = verCur.compareTo(verNew) < 0;
                }
                if(fMatch) {
                    oValueNew.incrementVersion();
                    entry.setValue(oValueNew, false);
                    return NO_RESULT;
                } else {
                    return fReturn ? oValueCur : NO_RESULT;
                }
            } else {
                return NO_RESULT;
            }
        }
    }
    Exception in thread "main" (Wrapped: Failed request execution for DistributedCache service on Member(Id=1, Timestamp=2012-08-09 18:02:13.598, Address=192.168.1.1:8088, MachineId=49553,
     Location=site:,machine:StBook,process:18387, Role=IntellijRtExecutionAppMain) (Wrapped) unknown user type: java.lang.Object) java.io.IOException: unknown user type: java.lang.Object
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:36)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onInvokeAllRequest(PartitionedCache.CDB:97)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$InvokeAllRequest.onReceived(PartitionedCache.CDB:111)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:34)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:33)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.io.IOException: unknown user type: java.lang.Object
         at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:351)
         at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java:2597)
         at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:211)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterValueToBinary.convert(PartitionedCache.CDB:3)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.invokeAll(PartitionedCache.CDB:63)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onInvokeAllRequest(PartitionedCache.CDB:78)
         ... 7 more
    Caused by: java.lang.IllegalArgumentException: unknown user type: java.lang.Object
         at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:430)
         at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:419)
         at com.tangosol.io.pof.PofBufferWriter.writeUserType(PofBufferWriter.java:1671)
         at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1623)
         at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:345)
         ... 12 more

    The problem is that you try to return an instance of the EntryProcessor NO_RESULT and No_Result is of type Object. Coherence cannot serialize an ordinary object, so you get this error. You need to do something No_RESULT that can be serialized - object to primitive type or a custom class that is serializable POF.

    JK

  • How to remove the object dynamically?

    Hi all

    I created an object dynamically. But I don't know how to remove dynamically in QML.

    I called the function to "destroy ()", but I don't know it works or not. The code is as follows:

    LogView.qml

    import bb.cascades 1.0
    
    ScrollView {
        id:logviewaaa
    
        signal addnewlog
    
        property variant number:100
        property variant log1
        property variant log2
        property variant log3
        property variant log4
        property variant log5
        property variant log6
        property variant log7
        property variant log8
        property variant log9
        property variant log10
    
        onAddnewlog:{
    
            number=logcontain.count()
            console.log("the log number is "+number)
            if(number == 0)
            {
                console.log("ready to add the first log");
                log1 = log.createObject(logcontain);
                console.log("ready to add the first log");
                logcontain.add(log1);
    
            }else if(number ==1){
    
                log2 = log.createObject(logcontain)
                logcontain.add(log2)
    
            }else if(number ==2){
                log3 =log.createObject(logcontain)
                logcontain.add(log3)
            }else if(number ==3){
                log4=log.createObject(logcontain)
                logcontain.add(log4)
            }else if(number == 4){
                log5=log.createObject(logcontain)
                logcontain.add(log5)
            }else if(number ==5){
                log6=log.createObject(logcontain)
                logcontain.add(log6)
            }else if(number ==6){
                log7=log.createObject(logcontain)
                logcontain.add(log7)
            }else if(number ==7){
                log8=log.createObject(logcontain)
                logcontain.add(log8)
            }else if(number ==8){
                log9=log.createObject(logcontain)
                logcontain.add(log9)
            }else if(number ==10){
                log10=log.createObject(logcontain)
                logcontain.add(log10)
            }
         }
    
        Container{
         id:logcontain      
    
        onCreationCompleted:{
        }
    
          attachedObjects:[
              ComponentDefinition{
                  id:log
                  source:"Log.qml"
              }
    
          ]
    
        }
    
    }
    

    Log.QML:

    import bb.cascades 1.0
    
        Container {
           id:root
            signal deletethislog
    
            TextArea{
                id:recordlog
                inputMode:TextAreaInputMode.Text
            }
        Container {
             id:buttoncontain
            layout: StackLayout {
                orientation: LayoutOrientation.LeftToRight
            }
            Button {
                id: edittext
                imageSource: "asset:///icons/ic_edit.png"
                onClicked: {
                    recordlog.editable = true
                }
    
            }
            Button {
                id: oktext
                imageSource: "asset:///icons/ic_done.png"
                onClicked: {
                    recordlog.editable = false
                }
    
            }
            Button{
                id:deletetext
                imageSource: "asset:///icons/ic_delete.png"
                onClicked: {
                    destroy()
                }
    
                layoutProperties: AbsoluteLayoutProperties {
    
                }
                horizontalAlignment: HorizontalAlignment.Right
    
            }
        }
        onCreationCompleted:{
        }
    }
    

    Thank you.

    brad_qqq

    I solved this problem. I always use "destroy()" function to solve. The code is as follows:

    LogView.qml

    import bb.cascades 1.0
    
    ScrollView {
        id:logviewaaa
    
        signal addnewlog
    
        property variant number:100
        property variant log1
        property variant log2
        property variant log3
        property variant log4
        property variant log5
        property variant log6
        property variant log7
        property variant log8
        property variant log9
        property variant log10
    
        onAddnewlog:{
    
            number=logcontain.count()
            console.log("the log number is "+number)
            if(number == 0)
            {
                console.log("ready to add the first log");
                log1 = log.createObject(logcontain);
                console.log("ready to add the first log");
                logcontain.add(log1);
                log1.objectaaa=log1
                log1.maincontain=logcontain
    
            }else if(number ==1){
    
                log2 = log.createObject(logcontain)
                logcontain.add(log2)
                log2.objectaaa = log2
                log2.maincontain = logcontain
    
            }else if(number ==2){
                log3 =log.createObject(logcontain)
                logcontain.add(log3)
                log3.objectaaa = log3
                log3.maincontain = logcontain
            }else if(number ==3){
                log4=log.createObject(logcontain)
                logcontain.add(log4)
                log4.objectaaa = log4
                log4.maincontain = logcontain
            }else if(number == 4){
                log5=log.createObject(logcontain)
                logcontain.add(log5)
                log5.objectaaa = log5
                log5.maincontain = logcontain
            }else if(number ==5){
                log6=log.createObject(logcontain)
                logcontain.add(log6)
                log6.objectaaa = log6
                log6.maincontain = logcontain
            }else if(number ==6){
                log7=log.createObject(logcontain)
                logcontain.add(log7)
                log7.objectaaa = log7
                log7.maincontain = logcontain
            }else if(number ==7){
                log8=log.createObject(logcontain)
                logcontain.add(log8)
                log8.objectaaa = log8
                log8.maincontain = logcontain
            }else if(number ==8){
                log9=log.createObject(logcontain)
                logcontain.add(log9)
                log9.objectaaa = log9
                log9.maincontain = logcontain
            }else if(number ==10){
                log10=log.createObject(logcontain)
                logcontain.add(log10)
                log10.objectaaa = log10
                log10.maincontain = logcontain
            }
         }
    
        Container{
         id:logcontain      
    
        onCreationCompleted:{
        }
    
          attachedObjects:[
              ComponentDefinition{
                  id:log
                  source:"Log.qml"
              }
    
          ]
    
        }
    
    }
    

    Log.QML:

    import bb.cascades 1.0
    
        Container {
           id:root
           //objectName:"thislog"
            signal deletethislog
            property variant objectaaa
            property variant maincontain
    
            TextArea{
                id:recordlog
                inputMode:TextAreaInputMode.Text
            }
        Container {
             id:buttoncontain
            layout: StackLayout {
                orientation: LayoutOrientation.LeftToRight
            }
            Button {
                id: edittext
    
                imageSource: "asset:///icons/ic_edit.png"
                onClicked: {
                    recordlog.editable = true
                }
    
            }
            Button {
                id: oktext
                imageSource: "asset:///icons/ic_done.png"
                onClicked: {
                    recordlog.editable = false
                }
    
            }
            Button{
                id:deletetext
                imageSource: "asset:///icons/ic_delete.png"
                onClicked: {
    
                   selfdestroy()
                }
    
                layoutProperties: AbsoluteLayoutProperties {
    
                }
                horizontalAlignment: HorizontalAlignment.Right
    
            }
        }
        onCreationCompleted:{
            deletetext.clicked.connect(deletethislog)
        }
        function selfdestroy(){
            objectaaa.destroy()
            maincontain.remove(objectaaa)
    
        }
    }
    

    brad_qqq

  • Type of the object called several times Oracle constructor

    I have an object of type with a custom constructor. In SQL, when I reference attributes the constructor is called several times in Oracle 11.2.0.4.

    1. Why the constructor is called more than once?
    2. How can I stop it?

    My current job is about to reference attributes and use the / * + materialize * / tip.


    Problem installation

        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 solution is described in this thread... Access to the fields of an object custom type... which makes use of a type of collection combined with SCOREBOARD operator, like this...

    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

  • SELECT statement to return a type in Oracle objects

    Hi all, I have created a small system for Uni using oracle objects and types. I have a table person with type of seller under the person table and the type of claimant to the title of the person table. I need the select statement to return data of the person, table, but only the type of applicant data. for example, SELECT * FROM person_tab, WHERE the type is applicant_t. I know it's probably simple, but just can't get the syntax right. The code all series just may not get the right to choose. Thanks for your time.

    create type appointment_t;
            
    create type property_t;
    
    create type telephone_t as object (
        weekdayDaytime varchar2(15),
        weekdayEveningAndWeekend varchar2(15));
    
    create type person_t as object (
        person char(6))
        not final;
    
    create type appointment_list_t as table of ref appointment_t;
    
    create type property_list_t as table of ref property_t;
    
    create type salesperson_t under person_t (
        sSurname varchar2(20),
        sForename varchar2(20),
        dateOfBirth varchar2(12),
        makes appointment_list_t,
        member function appointments_made return number );
    
    create type applicant_t under person_t (
        aSurname varchar2(20),
        aForename varchar2(20),
        dateOfBirth varchar2(12),
        aAddressLine1 varchar2(25),
        aAddressLine2 varchar2(25),
        aTown varchar2(20),
        telephoneNums telephone_t,
        maxPrice number(10),
        desiredArea varchar2(20),
        attends appointment_list_t,
        member function appointments_attended return number );
    
    create or replace type body salesperson_t as
    member function appointments_made return number is
        total number;
    begin
        total := self.makes.count;
        return total;
        end;
    end;
    
    create or replace type body applicant_t as
    member function appointments_attended return number is
        total number;
    begin
        total := self.attends.count;
        return total;
        end;
    end;
    
    create or replace type appointment_t as object (
        appointment char(10),
        appdate date,
        apptime varchar2(15),
        appointmentType varchar2(15),
        levelOfInterest integer(3),
        offerMade number(10),
        is_made_by ref salesperson_t,
        is_attended_by ref applicant_t,
        is_related_to ref property_t);
        
    create or replace type property_t as object (
        property char(10),
        dateOfRegistration date,
        propertyType varchar2(15),
        bedrooms integer(2),
        receptionRooms integer(2),
        bathrooms integer(2),
        garage varchar2(5),
        garden varchar2(6),
        regionArea varchar2(20),
        pAddressLine1 varchar2(20),
        pAddressLine2 varchar2(20),
        pTown varchar2(20),
        askingPrice varchar2(20),
        relatesTo appointment_list_t);
    
    create table person_tab of person_t (
        person primary key );
        
    create table property_tab of property_t (
        primary key(property))
        nested table relatesTo store as relates_to_table;
        
    create table appointment_tab of appointment_t (
        primary key (appointment),
        scope for (is_made_by) is person_tab,
        scope for (is_attended_by) is person_tab,
        scope for (is_related_to) is property_tab);
        
        
    
    insert into person_tab
    values (salesperson_t('s001', 'Fontigue', 'Farquar', '22-feb-1980', appointment_list_t()));
    
    insert into person_tab
    values (salesperson_t('s002', 'Richmond', 'Neil', '30-feb-1983', appointment_list_t()));
    
    insert into person_tab
    values (salesperson_t('s003', 'Devere', 'Jeremy', '03-mar-1977', appointment_list_t()));
    
    insert into person_tab
    values (salesperson_t('s004', 'Schofield', 'Paul', '07-dec-1969', appointment_list_t()));
    
    insert into person_tab
    values (salesperson_t('s005', 'Johnson', 'Richard', '04-jul-1992', appointment_list_t()));
    
    insert into person_tab
    values (salesperson_t('s006', 'Stevens', 'Rupert', '22-may-1989', appointment_list_t()));
    
    
    
    insert into person_tab
    values (applicant_t('ap007', 'Hadfield', 'Linda', '22-nov-1981', '3 Duckdoo Avenue', 'Rosemont', 'Neath Port Talbot',
    telephone_t('01639877103', '07756338175'), '110000', 'Mumbles', appointment_list_t()));
    
    insert into person_tab
    values (applicant_t('ap008', 'Walsh', 'Riley', '18-sep-1974', '12 George Street', 'Taibach', 'Neath Port Talbot',
    '01639890337', '075982228741', '125000', 'Ten Acre Wood', appointment_list_t()));
    
    insert into person_tab
    values (applicant_t('ap009', 'Kennedy', 'Shaun', '11-dec-1972', '101 Granada Close', 'Waun Wen', 'Swansea',
    '01792558447', '07894558123', '150000', 'Central Swansea', appointment_list_t()));
    
    insert into person_tab
    values (applicant_t('ap010', 'Redgrave', 'Steven', '30-jun-1988', '47 Victoria Gardens', 'City Apartments', 'Neath',
    '01639770183', '07774273391', '95000', 'Neath', appointment_list_t()));
    
    insert into person_tab
    values (applicant_t('ap011', 'Hopkins', 'John', '07-feb-1979', '130 Flanders Court', 'Richfield', 'Bridgend',
    '01656889227', '05589337123', '137500', 'Brechfa', appointment_list_t()));
    
    insert into person_tab
    values (applicant_t('ap012', 'Glover', 'Germaine', '14-aug-1983', '32 Regent Crescent', 'Cranforth', 'Cardiff', 
    '01210887336', '07975625195', '170000', 'Cardiff West', appointment_list_t()));
    
    

    
    

    The one I am running made the telephone_t in all households.

    Happy that you have your code working but that was not my point

    It comes to you providing us with the correct instructions to actually run the test case and help you efficiently.

    Regarding your last question, use the function of REGAL to caster level being superior in one of its subtype.

    for example

    SQL> select person
      2       , treat(object_value as applicant_t).aSurname as surname
      3       , treat(object_value as applicant_t).aForename as forename
      4  from person_tab
      5  where object_value is of (applicant_t) ;
    
    PERSON SURNAME              FORENAME
    ------ -------------------- --------------------
    ap007  Hadfield             Linda
    ap008  Walsh                Riley
    ap009  Kennedy              Shaun
    ap010  Redgrave             Steven
    ap011  Hopkins              John
    ap012  Glover               Germaine
    
    6 rows selected.
    
  • Types &amp; confusion of object

    Hi all

    10.2.0.4
    SLES 10

    I have not yet uses types and objects eversince. And how to use it even if I read the docs, I'm confused. :(

    For example, I create type with the same description as the EMP table:
    create or replace 
    TYPE             "EMP" AS OBJECT (
    EMPLOYEE_ID                             NUMBER(6),
     FIRST_NAME                              VARCHAR2(20),
     LAST_NAME                               VARCHAR2(25),
     EMAIL                                       VARCHAR2(25),
     PHONE_NUMBER                         VARCHAR2(20),
     HIRE_DATE                                DATE,
     JOB_ID                                      VARCHAR2(10),
     SALARY                                     NUMBER(8,2),
     COMMISSION_PCT                       NUMBER(2,2),
     MANAGER_ID                              NUMBER(6),
     DEPARTMENT_ID                         NUMBER(4));
    How is different from the EMP table? How to use or manipulate this?

    I can also count (*), update, delete, insert and truncate her?

    Thank you very much

    zxy

    Published by: yxes2013 on 21.4.2013 19:11 > > > adding versions

    yxes2013 wrote:

    So it's more a java programmers? This is the reason why I have not the slightest idea or interest that the use of this thing.

    Nothing to do with Java. Everything about an extra set of database tools to use in the development of solutions.

    An object type is called a class in an object oriented programming language.

    // create an abstract class as parent class for defining animals
    SQL> create or replace type TAnimal is object(
      2          animal_id       integer
      3  ) not final;
      4  /
    
    Type created.
    
    // create a subclass under animals for horses - it is  a "final"
    // class and cannot be further sub-classed
    SQL> create or replace type THorse under TAnimal(
      2          horse_type      varchar2(20),
      3          horse_color     varchar2(50)
      4  ) final;
      5  /
    
    Type created.
    
    // we can create a persistent container, aka SQL object table,
    // for a class - including abstract classes
    SQL> create table animals of TAnimal(
      2          constraint pk_animals
      3          primary key( animal_id)
      4          using index
      5  );
    
    Table created.
    
    // we can insert any subclass into the SQL object table
    SQL> insert into animals values( THorse(1,'Appaloosa','Blanket with spots') );
    
    1 row created.
    
    // we see the abstract class properties when querying the table
    SQL> select a.* from animals a;
    
     ANIMAL_ID
    ----------
             1
    
    // we can also select all horses (sub-class) from the list of animals
    SQL> select
      2          a.animal_id,
      3          treat(value(a) as THorse).horse_type    as HORSE_TYPE,
      4          treat(value(a) as Thorse).horse_color   as HORSE_COLOR
      5  from       animals a
      6  where      value(a) is of (THorse)
      7  /
    
     ANIMAL_ID HORSE_TYPE           HORSE_COLOR
    ---------- -------------------- --------------------
             1 Appaloosa            Blanket with spots
    
    // we can now add new subclasses to an existing parent class
    SQL> create or replace type TDog under TAnimal(
      2          dog_name        varchar2(10)
      3  ) final;
      4  /
    
    Type created.
    
    // and we can add objects of this class to the existing animals
    // (parent class) table - note that the table had no idea that dogs
    // existed at the time it was created
    SQL> insert into animals values( TDog(2,'Lassie') );
    
    1 row created.
    
    // we can look at the objects stored in the animals container
    SQL> select value(a) as ANIMAL_OBJECT from animals a;
    
    ANIMAL_OBJECT(ANIMAL_ID)
    --------------------------------------------------
    THORSE(1, 'Appaloosa', 'Blanket with spots')
    TDOG(2, 'Lassie')
    
    // we can process the objects via standard SQL
    SQL> select
      2          a.animal_id,
      3          case
      4                  when value(a) is of (TDog) then
      5                          'Animal is a dog called '||
      6                          treat(value(a) as TDog).dog_name
      7                  when value(a) is of (THorse) then
      8                          'Animal is horse breed '||
      9                          treat(value(a) as THorse).horse_type
     10                  else
     11                          'Unknown animal'
     12          end     as COMMENTS
     13  from       animals a;
    
     ANIMAL_ID COMMENTS
    ---------- -------------------------------
             1 Animal is horse breed Appaloosa
             2 Animal is a dog called Lassie
    
    SQL>
    

    This shows, quite simply, how object classes can be created and used as lines and tables.

    Classes can also be used to add new SQL types to help you deal with complex SQL queries. For example, in {message identifier: = 10962761}, a type is used to provide a list of the values in columns in a sorted order.

    Classes can also be used to define structures SQL that is returned and populated by data sources NON-SQL. For example, in {message identifier: = 10158148}, data CSV from a web interface are transformed into a SQL data and an SQL interface using object types and using a pipeline to do what it's designed to do - turn data.

    Object classes also supports of the more flexible interfaces in the PL/SQL language. Instead of a caller directly using something like DBMS_PIPE, a class can be created that provides a much more flexible and intuitive interface for the caller to use.

    So not - nothing to do with Java. Everything about a new set of tools in SQL and PL/SQL (not this again, like a lot of this was introduced in Oracle 8i and have since been improved on new versions).

    One of the best examples of this new feature, is the type of custom object XMLTYPE SQL data - have a look at it. It's an excellent showcase for how a class should look like, what methods it should support and type of features, it must provide.

  • ON the collection of type of the object does not not with GROUP BY

    Hello

    I have an object of type with the 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 simple SQL without no aggregation, the distinct keyword works well and returns me the separate entry of my type of object 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 a wide range in group by, the separate no longer works.
    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 are cases where I need to return collections with more than one, separate entries in it.

    Is there something that I am missing?
    Thank you
    Bruno

    Not a bug, rather an undocumented feature.

    Here are some alternatives that you can test:

    (1) using the operator SET 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 the 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
    ;
    
  • How to get the data type of an object?

    I have some custom classes, and I would like to make conditional function that behaves differently depending on the data type of the object. How can I do this?

    you could do something like

    var obj:CustomObject = new CustomObject();

    If (obj is Objetpersonnalise)

    {

    do something

    }

    or you could look at using getQualifiedClassName() or getDefinitionByName()

  • ExternalInterface: Type? String, object and any types?

    Hello dear guys,

    I want to know ExternalInterface - just, I have same problem with string or array - if I like it.

    But I work with AS3 with-Javascript block like Api Libraries Facebook thing.

    I just know same functions for Boolean and object...

    The code is MyLibrary.as

    package...

    {

    to import flash.external.ExternalInterface;

    public class MyLibraray

    {

    /**

    * MyLibrary output

    */

    private static var _exit:Object;

    Public Shared function Exit (): void

    {

    try {}

    {if (ExternalInterface.available)}

    _exit(2) = ExternalInterface.call("saveglobalscore",score) (jsBirdge.script ());

    _exit(2) = ExternalInterface.call("saveglobalscore",score) ("JSL.jsExit"); //

    }

    } catch (error: Error) {}

    }


    }

    }

    And jsBirdge.as <-c' block with Javascript in XML Format and the Format of Doement as a Version of Javascript in Actionscript

    package...

    {

    to import flash.external.ExternalInterface;

    public class jsBirdge

    {

    private static var NS:String = "JSL";

    public static void script (): String

    {

    try {}

    {if (ExternalInterface.available)}

    ExternalInterface.call("saveglobalscore",score) (script_js);

    ExternalInterface.call("saveglobalscore",score) ("JSL.setSWFObject", ExternalInterface.objectID);

    }

    } catch (error: Error) {}

    return NS;

    }

    script_js:XML = private static const

    < script >

    <! [CDATA]

    function () {}

    curwin var = Titanium.UI.currentWindow;

    JSL = {}

    setSWFObjectID: function {(swfObjectID)

    JSL.swfObjectID = swfObjectID;

    },

    / * Functions * /.

    jsExit: function() {}

    Titanium.Exit ();

    }

    };

    }

    []] >

    < /script >;

    }

    }

    How ExternalInterace works with the current type?

    If I use call custom such as exit to titanium Desktop ExternalInterface will verify current type - as the type exit() function = Titanium.exit (); as the Type "String".

    Or another example: file and the FileStream file system types as an object, is it good?

    Or Booleam example true or false as the type Booleam. ...

    It is posskible that externalInterface works very well with any types/functions?

    I've been tested with ExternalInterface and Javascript = bulk IT works fine... Look out! http://developer.Appcelerator.com/question/135288/how-do-you-know-Flash-and-titanium

    But I hate disturbated function of communication as external GWT / fscommand...

    I want to only use AS3 / JS. Just, I missed this fine example, because I remember - where are the examples? I want because you'd think all current result

    Thanks I hope because I get nice answer / result to migrate the types / function for externalinterface via inblock: Javascript.

    Hello

    I've not really understood with your post above. But you can communicate with javascript from flex by the way below.

    JavaScript:

    function CallMe()

    {

    Alert ("Call Me");

    }

    function CallMeWithArg (value)

    {

    Alert ("this is your value:" + value);

    }

    Action Script:

    ExternaInterface.call ('CallMe'); without argument.

    ExternaInterface.call ('CallMeWithArg', 'HelloWorld'); with the argument.

  • How to create objects dynamically (with # dynamics of parameters)

    I need to create a set of objects based on a definition of an XML file (obtained from the server) and add them to my scene.

    I understand how to create the object using getDefinitionByName (and limitations on classes that need to be referenced to be loaded into the SWF file).

    But some objects require parameters for the constructor, and others do not. The XML code can pass easily in required parameter information, but I can't figure out how to create a new object with a dynamic set of arguments (something similar to the use of the Function.Call method of (obj, argsArray).)


    For example, I need something like this works:

    var MC = new (getDefinitionByName (str) as class). call (thisNewThing, argsArray)

    Currently, it is that I can get:

    MC var = new (getDefinitionByName (str) as class)(static, list, arguments)

    Thoughts?

    I think what Dave is asking is a little different.

    He is eager to know how to call the constructor of an object dynamically (when he knows that the number of constructor arguments when running).

    This class I will do it, but seems to be a hack:

    s http://code.Google.com/p/jsinterface/source/browse/trunk/source/core/AW/utils/ClassUtils.a? spec = svn12 & r = 12

    See the "call" method, which has first counts the number of arguments and then calls one of the "n" construction methods based on the number of constructor args.

    I have yet to find a clean way of AS3 to do ala things 'call' however.

    -Corey

  • CREATE TYPE subscription_type AS OBJECT - ERROR

    I'm not able to create objects of type also tried with different versions of oracle.
    I am currently using Oracle 11 g enterprise edition (2.9 GB).
    The problem is when I create an object TYPE and when I finish the command with a semicolon ';', oracle sql does not stop only (the query does not run) the loop goes on and on.
    I did like this and found that the SYNTAX is also perfect.

    SQL > CREATE TYPE subscription_type AS OBJECT
    2 (street varchar2 (30),)
    3 city varchar2 (30),
    4 PIN number code (10));
    5
    6
    7
    8...
    It turns on and it never ends. Command runs.
    Help, please!

    You must end with a slash: /

    create type address_type as object
           (street varchar2 (30), city varchar2 (30), pincode number (10));
    /
    
  • tables dynamic thread-safe

    Hi all

    trying to convert my application single-threaded for multithreading, that I met a new obstacle:

    I would like to have a global data structure. This structure must be dynamically allocated and reallocated as the number of threads (and thus the size of the structure) depends on the program execute / user.

    The main thread as long as secondary threads should be able to access this structure, so I need to use a variable in thread safe, somehow. All the samples I've traveled so far, either use a single variable using the DefineThreadSafeScalarVar macro, or an array of size fixed by using the DefineThreadSafeArrayVar macro.

    I haven't found an example of this type of a dynamic array, unfortunately... Some kind soul would be willing to teach me how to proceed?

    Thank you

    Wolfgang

    In your case, you must use a TSV scalar that contains the pointer is allocated/re-allocated. See the following example of a TSV that mimics a dynamic array of integers. In some cases, a better solution would be to have a TSV scalar that contains a list, say, box tools ListType.

    #include

    DefineThreadSafeVar (int *, DynMem);

    void main (void)
    {
    int * pDynMem, i.;
       
    Initialize the TSV
    InitializeDynMem();
       
    Define HSV 'table' to hold 10 integers
    SetDynMem (malloc (10 * sizeof (int)));
       
    Set and get the 'elements' of TSV
    pDynMem = GetPointerToDynMem();
    for (i = 0; i< 10;="">
    {
    (* pDynMem) [i] = i;
    printf ("DynMem [%d] = %d\n", (* pDynMem) [i], i);
    }
    ReleasePointerToDynMem();
       
    Resize the TSV "array".
    pDynMem = GetPointerToDynMem();
    * pDynMem = realloc (* pDynMem, 20 * sizeof;)
    for (i = 10; I)< 20;="">
    (* pDynMem) [i] = i;
    for (i = 0; i< 20;="">
    printf ("DynMem [%d] = %d\n", (* pDynMem) [i], i);
    ReleasePointerToDynMem();
       
    Free TSV "array".
    pDynMem = GetPointerToDynMem();
    Free(*pDynMem);
    ReleasePointerToDynMem();
       
    Cancel initialization of TSV
    UninitializeDynMem();
    }

  • Cannot type password for buy more storage iCloud

    When I try to buy more storage via the iCloud pane in the system preferences panel, I can access the 'Complete purchase', but can only type the first character of my password in the field and nothing more.  I can't click the field to insert my rear slider to type the rest of my password, but I can click on the link "Forgotten?" for password recovery.  By clicking on the field to type in my password, it selects the box.  I don't know why this is happening, but it is not allowing me to purchase more storage iCloud.  Help, please.

    Thanks for the review!  -A

    The work around that was posted is to go into settings/iCloud on a device and make the adjustments there.

Maybe you are looking for