Last Object Inserted into Vector Appears in Every Position

I am experiencing difficulty with adding objects to vectors. The object that is added last appears in all locations in the vector, from 0 to size-1. The below program illustrates my problem. I expect it to print
A 1
B 2
C 3
D 4
Yet it prints
D 4
D 4
D 4
D 4
If anyone has some advice, I would greatly appreciate it. Thank you.
import java.io.*;
import java.util.*;
class CharAndInt
  private static char x;
  private static int y;
  public CharAndInt(char a, int b)
    x = a;
    y = b;
  public char getX()
    return x;
  public int getY()
    return y;
class Test
  private static Vector v;
  public static void addToV (char a, int b)
    CharAndInt tmp = new CharAndInt(a, b);
    v.add(tmp);
  public static void main (String args[]) throws IOException
    v = new Vector();
    char arrC [] = { 'A', 'B', 'C', 'D' };
    int arrI [] = { 1, 2, 3, 4 };
    CharAndInt tmp;
    for (int i = 0; i < 4; ++i)
      addToV(arrC, arrI[i]);
for (int i = 0; i < 4; ++i)
tmp = (CharAndInt) v.get(i);
System.out.println(tmp.getX() + " " + tmp.getY());
Message was edited by:
blueicemd

In ther CharAndInt class you have made x and y static. They
shouldn't be.

Similar Messages

  • Help w/ Flash Object inserted into DW page

    Hi,
    I'm using DW MX2004 on a Pwrbk G4. I created a Flash object
    (a page-flipping gallery) in Flash, and while it previews fine in
    Flash MX'04 (size of the .swf in pixels, I WANT it to be 1050 W
    & 713 H so the page is big enough to view well on a browser and
    the pages can flip correctly), once the object is inserted into DW,
    it isn't showing up as the same size. The default size in DW is 550
    x 440 I think, and when I try to change the dimensions--even to the
    exact size it was in Flash--the images once previewed are always
    distorted or the preview shows only part of the image and the pages
    aren't flipping (this, I believe b'cos the entire .swf movie isn't
    displayed so the corners can be dragged/clicked). I know I'm doing
    something wrong or missing some step, can someone help?
    Thanks

    I am not sure what exactly you are experiencing but it sound
    like something somewhat similar to what I recently went through. I
    tried to embed a swf in my HTML page using DW and there was a
    border that would appear that was not there in FLash. I eventually
    found a setting in Flash Publish settings that said " no border "
    ...this was under the "HTML" settings in the Publish settings
    dialog box. I published my html page and then cut most of the code
    from that page and manually embed it in my Dw html page. Kind of
    pain but it worked.
    Try publishing the HTML page from flash and then viewing that
    page in DW and see if your swf is the right size. It may be that
    you can't use DW to Embed your SWF.
    Jordy

  • Unexpected behavior when creating Objects in a Vector

    I have a situation where Objects in a Vector appear to be getting corrupted. The context is this: I obtain a ResultSet from a database, create a Vector of Strings for each row, and a Vector of these row vectors for the entire ResultSet. This is passed to a method where a POJO is created for each row. This method returns a Vector of these POJOs. In the Object constructor, a String array of initial values is created and also values are assigned to individual variables. Here is a snippet with the Object constructor
    public class RefAuthorItem {
         private final String refKey;
         private String authorKey, firstName, lastName, itemKey;
         private int authorPosition;
         private boolean isDeleted, isNew;
         // Keep a copy of the original values
         private final String[] oldValues;
          * The constructor for the data object item.
          * @param dataVals     a String array of the data values
          * @param isNewVal     boolean true if this is a new item, false if it is
          *                                              an existing item
         public RefAuthorItem(final String[] dataVals, final boolean isNewVal) {
              oldValues = dataVals;
              authorKey = dataVals[RefQueryBuilder.AUTH_NUM];
              firstName = dataVals[RefQueryBuilder.AUTH_FIRST_NAME];
              itemKey = dataVals[RefQueryBuilder.AUTH_PKEY];
              lastName = dataVals[RefQueryBuilder.AUTH_LAST_NAME];
              refKey = dataVals[RefQueryBuilder.AUTH_REF_FKEY];
              isNew = isNewVal;
              isDeleted = false;
              // the author position integer value is used to sort the display
              authorPosition =
                        Integer.parseInt(dataVals[RefQueryBuilder.AUTH_POS]);
         }It seems the oldValues[] values should be identical to the corresponding individual variable values. When the following code is used to create the objects, they are not.
              final boolean isNew = isNewVal;
              Vector<RefAuthorItem> returnSet = new Vector<RefAuthorItem>();
              final String queryString = QueryBuilder
                   .getRefQuery(keyString, tableName);
              Vector<Vector> dataSet = QueryDB.getResultSet(queryString);
              int columnTot = dataSet.firstElement().size();
                    String[] itemVals = new String[columnTot];
              for (Iterator iter = dataSet.iterator(); iter.hasNext();) {
                   Vector element = (Vector) iter.next();
                   for (int i = 0; i < columnTot; i++) {
                        itemVals[i] = (String) element.get(i);
                   RefAuthorItem item = new RefAuthorItem(itemVals, isNew);
                   returnSet.add(item);
              }What happens is this. I returned four rows from the database and the oldValues[] array for each of the four corresponding objects contains the data from the fourth row. However, when I retrieve the corresponding individual values (e.g., authorLastName) from the Object, it is correct. I checked the object values (oldValues versus individual values retrieved via getters) right after the object is created (the line: RefAuthorItem item = new RefAuthorItem(itemVals, isNew);) and get the correct results. Also, results are correct when the itemVals constructor is moved within the loop, as below
              int columnTot = dataSet.firstElement().size();
              for (Iterator iter = dataSet.iterator(); iter.hasNext();) {
                   Vector element = (Vector) iter.next();
                   String[] itemVals = new String[columnTot];
                   for (int i = 0; i < columnTot; i++) {
                        itemVals[i] = (String) element.get(i);
                   RefAuthorItem item = new RefAuthorItem(itemVals, isNew);
                   returnSet.add(item);
              } There is a problem here. Am I missing a subtle Java issue with instantiating the String array within the loop? Or is there a problem with Vectors? Thanks!

    Dear ejp,
    In the non-working code, I rewrite the itemVals[], create a new RefAuthorItem using the itemVals[] and repeat. I checked the RefAuthorItem immediately after it was created (with println()) and the oldValues and individual String values in the object are concordant. However, after the loop is completed (all RefAuthorItems are created and added to the Vector), the oldValues[] in the objects all have the values from the last row. The individual String variables in the object all have the correct value from the ResultSet row.

  • The Tilda character inserts into my text without keyboard input.  Or any input.  Has anyone seen this?

    When I have an AI file open and in the text mode.  The Tilda character "~" is inserted into the text string every few minutes.  I can go away and when I come back there will be 20 "~" all in a row.  Is there any cure?

    tci,
    You may try the list, unless there is something wrong with the Tilde key (hanging or something).
    The following is a general list of things you may try when the issue is not in a specific file (you may have tried/done some of them already); 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save curent artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • ORA-01403: no data found error hile inserting into a table

    Hi,
    I am populating a PL/SQL table(Array) with the data. From that array inserting into a Actual table. Before inserting am checking array count. Array count is greater than 0. But I am getting "ORA-01403: no data found" exception. I am not getting why this error is displaying.
    Please someone help me. Below is the code.
    CREATE OR REPLACE PROCEDURE XXDL_TEST_INSERT
    IS
    BEGIN
       IF  t_array.count> 0 THEN
        FND_FILE.PUT_LINE (FND_FILE.LOG, t_array.count);
        FOR i IN t_array.FIRST..t_array.LAST
        LOOP
            INSERT INTO XXDL_TEST
            VALUES(t_array(i).name )
      END LOOP;
    END IF;
    EXCEPTION
      WHEN OTHERS THEN
        FND_FILE.PUT_LINE (FND_FILE.LOG,SQLERRM);
    END;Thanks
    Alaka

    It looks like your Array is sparsely populated:
    SQL> DECLARE
      2    TYPE l_tab_type IS TABLE OF VARCHAR2(10)
      3      INDEX BY BINARY_INTEGER;
      4    l_tab l_tab_type;
      5  BEGIN
      6    l_tab(1) := 'A';
      7    l_tab(2) := 'B';
      8    l_tab(3) := 'C';
      9    FOR i IN l_tab.FIRST .. l_tab.LAST LOOP
    10      dbms_output.put_line(l_tab(i));
    11    END LOOP;
    12  END;
    13  /
    A
    B
    C
    PL/SQL procedure successfully completed.
    SQL>
    SQL> DECLARE
      2    TYPE l_tab_type IS TABLE OF VARCHAR2(10)
      3      INDEX BY BINARY_INTEGER;
      4    l_tab l_tab_type;
      5  BEGIN
      6    l_tab(1) := 'A';
      7    l_tab(3) := 'B';
      8    l_tab(4) := 'C';
      9    FOR i IN l_tab.FIRST .. l_tab.LAST LOOP
    10      dbms_output.put_line(l_tab(i));
    11    END LOOP;
    12  END;
    13  /
    A
    DECLARE
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 10Edited by: JS1 on Apr 11, 2009 8:59 AM
    You should also be using the FORALL syntax with INDICES OF. Check out The Docs

  • May returning Clause be used w/ INSERT INTO...SELECT FROM

    Hi,
    I use Oracle 8i: 8.1.7.2.0.
    I'd like to insert multiple rows into a table, and get back certain inserted columns into a collection variable. Is this possible?
    Eg:
    INSERT INTO foo
    f1
    , f2
    SELECT b1, b2...
    FROM bar
    RETURNING f1 bulk collect into collection
    This compiles, but yields a "command not properly ended" error at runtime--I assume because the "returning" binds to the SELECT subquery, and not to the main INSERT query.
    Is there a way to do this?
    By the way, I already know this works when INSERTing just 1 row via the "values" clause.
    Regards,
    --IG                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    Try this way:
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL>
    SQL> SET SERVEROUTPUT ON
    SQL> DECLARE
      2     TYPE emp_t IS TABLE OF VARCHAR2(30);
      3     emp_list emp_t;
      4 
      5     TYPE emp_t2 IS TABLE OF NUMBER;
      6     emp_code emp_t2;
      7  BEGIN
      8 
      9     emp_list := emp_t('John',
    10                       'Doe',
    11                       'Max');
    12 
    13     FORALL i IN emp_list.FIRST .. emp_list.LAST
    14        INSERT INTO emp
    15           (id,
    16            NAME)
    17        VALUES
    18           (employees_seq.NEXTVAL,
    19            emp_list(i))
    20        RETURNING id BULK COLLECT INTO emp_code;
    21 
    22     FOR i IN emp_code.FIRST .. emp_code.LAST LOOP
    23        dbms_output.put_line(emp_code(i));
    24     END LOOP;
    25  END;
    26  /
    213
    214
    215
    PL/SQL procedure successfully completed
    SQL> commit;
    Commit complete
    SQL> select * from emp;
            ID NAME
           213 John
           214 Doe
           215 Max
    SQL>Regards,
    Edited by: Walter Fernández on May 8, 2009 12:59 PM -- Adding query on emp table...

  • Commit for every 1000 records in  Insert into select statment

    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
       from emp e , dept d
      where e.deptno = d.deptno       ------ how to use commit for every 1000 records .Thanks

    Smile wrote:
    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.Does the another table already have records or its empty?
    If its empty then you can drop it and create it as
    create your_another_table
    as
    <your select statement that return 60000000 records>
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .That is not the best way. Frequent commit may lead to ORA-1555 error
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:275215756923]A nice artical from ASKTOM on this one
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
    from emp e , dept d
    where e.deptno = d.deptno       ------ how to use commit for every 1000 records .
    It depends on the reason behind you wanting to split your transaction into small chunks. Most of the time there is no good reason for that.
    If you are tying to imporve performance by doing so then you are wrong it will only degrade the performance.
    To improve the performance you can use APPEND hint in insert, you can try PARALLEL DML and If you are in 11g and above you can use [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_parallel_ex.htm#CHDIJACH]DBMS_PARALLEL_EXECUTE to break your insert into chunks and run it in parallel.
    So if you can tell the actual objective we could offer some help.

  • #include "%(Filename)_i.h" inserted into C++ source after adding connection points to ATL object using wizard.

    What is the subsitution for this appearant macro?  Solution will not build if removed.
    Using
    Adding Connection Points to an Object directions.

    Hi Shawn,
    Since you have posted this issue to the VC++ forum, I think you would get better support there:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/8494410e-9578-4b67-a08d-3380aac10fcf/include-filenameih-inserted-into-c-source-after-adding-connection-points-to-atl-object?forum=vcgeneral#503cbc06-40a2-4073-a56e-1b384b11b56e
    So I will move this thread to the Off-topic forum. Thanks for your understanding.
    Sincerely,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How insert into another entity object

    Hi ,
    i hope find the solution for this case
    i am using jdeveloper 11.2
    and i have two entity object based on two table as follow
    1 - DocTransaction entity
    Attributes ( id , createdOn, createdBy ,modifiedOn,modifiedBy , docStatus-- default = 1-- , EmpId )
    2- transHistory entity
    Attributes ( id , transId--FK-- , Transdate, TransBy ,ToEmp , docStatus , docAction )
    when inserting row in DocTrasaction it will insert row in transHistory and when update docStatus in DocTransaction it will insert row with updated status in transHistory and so on ( every DML in first entity ocure will insert it in first entity )
    the problem is when docStatus updated after 7 days from creation with value (2 or 5 ) i want the row inserted in second entity with docStatus = 3 not ( 2 or 5 )
    and if docStatus in first entity not updated within 7 days then automatically change its status to 3
    my incomplete code in DocTrasactionImpl as follow
    *protected void doDML(int operation, TransactionEvent e)  {*
    super.doDML(operation, e);
    *if (operation == DML_INSERT) {*
    EntityDefImpl secDef = TranshistoryImpl.getDefinitionObject();
    TranshistoryImpl insert = (TranshistoryImpl)secDef.createInstance2(getDBTransaction(), null);
    insert.setTransId(this.getId().getSequenceNumber());
    insert.setTransBy(this.getCreatedBy());
    insert.setToEmp(this.getEmpId());
    insert.setDocStatus(this.getDocStatus());
    insert.setTransStatus(new Number(1));       // transaction still open
    *if (operation == DML_UPDATE) {*
    *// insert into history when update the status by user to 2 or 5 before 7 days from created the task*
    Date today = new Date();
    Long dateDiff =(today.dateValue().getTime())-(getCreatedOn().dateValue().getTime());
    Boolean checkBefore=( (this.getDocStatus().intValue() == 2 && dateDiff <=7 )||( this.getDocStatus().intValue() == 5 && dateDiff<=7)) ; // change status before 7 days
    Boolean checkAfter=( (this.getDocStatus().intValue() == 2 && dateDiff > 7 )||( this.getDocStatus().intValue() == 5 && dateDiff > 7)); // change status after 7 days
    if  ( checkBefore )      // update by user
    EntityDefImpl secDef = TranshistoryImpl.getDefinitionObject();
    TranshistoryImpl insert = (TranshistoryImpl)secDef.createInstance2(getDBTransaction(), null);
    insert.setTransId(this.getId().getSequenceNumber());
    insert.setTransBy(this.getModifiedBy());
    insert.setToEmp(this.getEmpId());
    insert.setDocStatus(this.getDocStatus());
    insert.setTransStatus(new Number(2)); //close transaction
    else  if  (checkAfter )  // update by user
    EntityDefImpl secDef = TranshistoryImpl.getDefinitionObject();
    TranshistoryImpl insert = (TranshistoryImpl)secDef.createInstance2(getDBTransaction(), null);
    insert.setTransId(this.getId().getSequenceNumber());
    insert.setTransBy(this.getModifiedBy());
    insert.setToEmp(this.getEmpId());
    insert.setDocStatus(new Number(3));//رد متأخر
    insert.setTransStatus(new Number(2));// close transaction
    this code not working will and also how can i update the docStatus automatic after 7 days from value 1 to 3
    thank you
    }

    What is not working, your logic when to create/update or new EO rows itself are not getting updated or created ?
    Amit

  • In captivate 8, how do you insert a company logo so that it appears on every slide?

    in captivate 8, how do you insert a company logo so that it appears on every slide?

    Put it on the main master slide and check the daughter master slides. Which theme do you use? Not all daughter master slides have automatically the main master objects, that is why I'm asking about the theme.

  • Re: vector values replaced upon row insertion into table

    This "newrow" array... I assume you create it once and reuse it every time you call the addrow method? If you do that, every entry in your vector refers to the same array. That makes all the entries look identical.

    hi..
    me too having same type of XML data to be inserted into oracle table
    i've to write procedure for this
    can u help me plz.....

  • Regions selection continues to come up every time a disc is inserted into computer

    I have an old Mac A1185 that I am trying to fix. The DVD player seems to have a mind of its own. Every time a disc is inserted into the drive the 'region' selection appears - I have selected the appropriate region and then the DVD player closes. Is there a patch or something i would be able to use to stop this from occurring?

    Try googling to see what are the available softwares for burning DVDs apart from Nero. You can also post in AUS(Anything Under the Sun) Forum, since many members who are using different DVD writers can give you better suggestions than me .

  • Problems with inserting elements into vectors

    Hi,
    I have a problem with the setElementAt() method for vectors.
    I want to initialise a vector that is same size as a previous vector declared in my program and insert float 0.0 in all the positions.
    The code below is a for loop to do just this where count is the size of the previous vector.
    for(int i=0;i<count; i++)
                   vLargest.setElementAt(zero,i);
              }i have declared zero as a float
    float zero = 0.0f;
    the error that i'm getting is that it that the vector cannot be applied to a float.
    Can anybody tell me what i'm doing wrong?
    Thanks

    Yes you need to store Objects in your Vector not primitives.
    float is not an Object it is a primitive. But Float is an object.

  • How to insert object values into table.

    Hi All,
    I have a problem with passing java object to procedure. Procedure is running properly when I execute in oracle,but it is not executing when I call from Java.
    I am getting Error :
    java.sql.SQLException: invalid name pattern: Pkg_Bulk_Insert.ITW_EMP_OBJ_ARRAY
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
         at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java)
         at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java)
         at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java)
         at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java)
         at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java)
         at JavaObjectToOracle.main(JavaObjectToOracle.java:31)
    Here I am copying my procedure,oracle version is 9i.
    Package specification:
    CREATE OR REPLACE PACKAGE Pkg_Bulk_Insert AS
    TYPE ITW_EMP_OBJ_ARRAY IS VARRAY(20) OF VARCHAR2(200);
    PROCEDURE BULK_INSERT_TEST(strTable IN ITW_EMP_OBJ_ARRAY);
    END Pkg_Bulk_Insert;
    package body:
    CREATE OR REPLACE PACKAGE BODY Pkg_Bulk_Insert AS
    PROCEDURE BULK_INSERT_TEST(strTable IN ITW_EMP_OBJ_ARRAY) AS
    i BINARY_INTEGER;
    BEGIN
    FORALL i IN 1..strTable.COUNT
    INSERT INTO TEMP(NAME)
    VALUES(strTable(i));
    COMMIT;
    END BULK_INSERT_TEST;
    END Pkg_Bulk_Insert;
    Here I am invoking the procedure:
    DECLARE
    x Pkg_Bulk_Insert.ITW_EMP_OBJ_ARRAY;
    BEGIN
    x := Pkg_Bulk_Insert.ITW_EMP_OBJ_ARRAY('A','B','C');
    Pkg_Bulk_Insert.BULK_INSERT_TEST(x);
    DBMS_OUTPUT.PUT_LINE('AFTER INSERTION');
    END;
    Please any body can help me on this regard.

    Your PL/SQL seems reasonable.
    My suspicion would be that the oracle.sql.ArrayDescriptor.createDescriptor class only supports persistent collection types, i.e. those declared at the schema level with CREATE TYPE.

  • Inconsistent datatypes error when inserting into a object

    I am trying to insert some test data into the table emp.I have managed to succesfully create the objects and types but when I try to insert into the emp table I get a inconsistent datatypes error however I have checked the datatypes and they all seem fine. Can anyone help me.
    thanks
    CREATE OR REPLACE TYPE Address_T AS object
    (ADDR1                VC2_40,
    ADDR2               VC2_40,
    CITY_TX          VC2_40,
    COUNTY_CD          VC2_40,
    POST_CD          VC2_40);
    CREATE OR REPLACE TYPE PERSON_T AS OBJECT (
    LNAME_TX           NAME_T,
    FNAME_TX           NAME_T,
    BIRTH_DATE          DATE,
    TELEPHONE          VC2_20,
    EMAIL               VC2_40);
    CREATE OR REPLACE TYPE EMP_T AS OBJECT (
    EMP_ID     NUMBER (10),
    PERSON     PERSON_T,
    ADDRESS ADDRESS_T,
    HIRE_DATE DATE)
    CREATE TABLE EMP OF EMP_T
    (EMP_ID NOT NULL PRIMARY KEY);
    INSERT INTO EMP VALUES (1,           
    PERSON_T('PETCH',
    'GAVIN',
    '23-JAN-80',
    '(01964)550700',
    '[email protected]'),
    ADDRESS_T('67 CANADA',
    'WALKINGTON',
    'BEVERLEY',
    'EAST YORKSHIRE',
    'HU17 7RL'),
    '11-FEB-02'
    ERROR at line 1:
    ORA-00932: inconsistent datatypes

    Gavin,
    What is your VC2_40 and NAME_T type definition? Your insert used these as varchar2, which is a built-in type not a user-defined type. If you explicitly define these to be varchar2's, the insert statement works fine.
    Regards,
    Geoff
    I am trying to insert some test data into the table emp.I have managed to succesfully create the objects and types but when I try to insert into the emp table I get a inconsistent datatypes error however I have checked the datatypes and they all seem fine. Can anyone help me.
    thanks
    CREATE OR REPLACE TYPE Address_T AS object
    (ADDR1                VC2_40,
    ADDR2               VC2_40,
    CITY_TX          VC2_40,
    COUNTY_CD          VC2_40,
    POST_CD          VC2_40);
    CREATE OR REPLACE TYPE PERSON_T AS OBJECT (
    LNAME_TX           NAME_T,
    FNAME_TX           NAME_T,
    BIRTH_DATE          DATE,
    TELEPHONE          VC2_20,
    EMAIL               VC2_40);
    CREATE OR REPLACE TYPE EMP_T AS OBJECT (
    EMP_ID     NUMBER (10),
    PERSON     PERSON_T,
    ADDRESS ADDRESS_T,
    HIRE_DATE DATE)
    CREATE TABLE EMP OF EMP_T
    (EMP_ID NOT NULL PRIMARY KEY);
    INSERT INTO EMP VALUES (1,           
    PERSON_T('PETCH',
    'GAVIN',
    '23-JAN-80',
    '(01964)550700',
    '[email protected]'),
    ADDRESS_T('67 CANADA',
    'WALKINGTON',
    'BEVERLEY',
    'EAST YORKSHIRE',
    'HU17 7RL'),
    '11-FEB-02'
    ERROR at line 1:
    ORA-00932: inconsistent datatypes

Maybe you are looking for