[ORA-22905] How to read a field of an object inside another object?

Greetings,
I'm a student and in a current exercise we have to work with the Object Oriented Programming functionality of Oracle.
In the database we defined an object type, which is then considered inside another object type. The thing is, that I cannot read an attribute of the inner object. I've read tens of websites but none of them have helped so far. I've read the PL/SQL User Guide and Reference document also.
The inner object is defined as follows:
create type address_t as object (
        street varchar(50),
        city varchar(50),
        pcode number(5,0)
        );The outer object has an object of type address_t inside it:
CREATE TYPE professor_t as OBJECT(
          code number(2),
          p_name varchar(50),
          address address_t,
          );Also, there is a table named PROFESSORS that stores objects of type professor_t
First of all, with a simple testing SQL statement I can see the data inside the object professor, even the object address_t:
SELECT * FROM PROFESSORS WHERE CODE = 13;returns the following:
CODE    |         NAME      |       ADDRESS
13      |         JOHN     |       MYSCHEMA.ADDRESS_T('FIFTH AVENUE','NEW YORK',12345)The thing is, I want to read the field street of the object address (of type address_t) inside professor (of type professor_t).
I could see everywhere that the way to go is to use point notation, and I've seen examples about the command VALUE, but none of the following SQL statements work:
SELECT VALUE(ADDRESS.STREET) FROM(
  SELECT CODE,P_NAME,ADDRESS FROM PROFESSORS WHERE CODE = 13);
SELECT ADDRESS.STREET FROM PROFESSORS WHERE CODE = 13;
SELECT PROFESSOR.ADDRESS.STREET FROM PROFESSORS WHERE CODE = 13;I'd really appreciate if someone could show me how to access the values of the field of the object inside an object.
Thanks in advance,
- David
Edited by: 858176 on May 11, 2011 6:53 PM Formatting

Great, this worked so far.
It is curious that you wrote 'profesores' but that is the actual name for the variable. I translated everything to english in order to post it here.
So, the statement is:
select value(t).DIRECCION.CIUDAD from profesores t;And It returned:
VALUE(T).DIRECCION.CIUDAD                         
Valencia                                          
New York
TijuanaAnd, applying the VALUE command to the statement:
select codigo,
nombre,
value(t).DIRECCION.CALLE,
value(t).DIRECCION.CIUDAD,
value(t).DIRECCION.CP
from profesores T WHERE T.CODIGO = 13;Resulting in:
CODIGO                 NOMBRE                                             VALUE(T).DIRECCION.CALLE                           VALUE(T).DIRECCION.CIUDAD                          VALUE(T).DIRECCION.CP 
13                     Pepito Pérez                                       Calle de los Rosales 0                           Valencia                                           46023                  That is EXACTLY what I needed.
Thanks Thomas, It was really helpful !
Edited by: 858176 on May 11, 2011 7:46 PM

Similar Messages

  • How to read table fields form a table  having length of 7 characters

    HI all,
    could you please tell me how to read table fields from a table having length 7 characters, i have requirement that in my ztable i have 30 fields out of which 20 fields are location fields, i want to select 20 fields which have 7 characters length.
    please could any body suggest me on this issue.
    thanks,
    sre.

    hi,
    try like this
    create a data variable of type i as
    data: len type i.
    create internal table for 20 fields as
    data:begin of itab,
               fld 1 type .......
            end of itab.
    data:itab type itab1 occurs 0 with header line.
    loop at itab2. // original internal table which all fields.
    read table itab2 with index sy-tabix.
    len = strlen (itab2-fld).
    if len eq 7.
          move itab2 itab1.
          append itab1.
    endif.
    endloop.
    if helpful reward some points.
    with regards,
    Suresh.A

  • How to read specific fields from BW table  into ABAP?

    Hi Experts,
    Can someone help me how to use to FM: RFC_READ_TABLE to read specific fields from a BW  table '/bic/zcust_chO01' which DOESN't EXIST IN ABAP.
    I am getting an error in OPTIONS & DATA parameters.
    Any help would be higly appreciated with points.
    Thanks
    Dan

    Dan,
    FM: RFC_READ_TABLE is a RF FM so by providing BW system's RF destination you can get the values from required table.
    TRY this:
    CALL FUNCTION RFC_READ_TABLE destination <BW_RF_destination>
    Susanth.

  • How to read Editable field in a table

    Dear friends,
    i have a table with 5 columns( one column is editable field ( Amount column)) pls check the below screen shot, , its binded with an internal table , now i want to edit the amount columns ( for eg 100 ), could any one pls let me know how to capture the editable value ( ie 100 ), when i am trying to read amount field , i am getting the old value ( ie 15,000),
    Thanks
    Vijaya

    Hi Laxmi,
    I am able to read the values before edited and after editing. Code i have written is in the ONENTER action method. I have simply read the Table node values.
    1. Applicaiton data
    2. Values In Debugging mode by clicking on Enter button on the second row.
    3. Edit second value and click on Enter
    Regards,
    Ravikiran.K

  • How to read dynamic field symbol

    hi all,
       ASSIGN (tabname) TO <fs_tab>.
       in above code i am passing dynamic table to fs_tab
      can anyone tell me how can i read this field symbol........
      in other words i want to read dynamic field symbols

    Hi,
    you could do without the field-symbols:
    select from variable table
    grtz,
    Koen

  • How to read data/fields of the pdf form

    Hi,
    i want to orchestrate a process where input is interactive forma and output is xml data.
    i mean i want to read data/fields of the pdf form.
    Which activity do i use on workbench.
    Regards
    Sunil

    Dieter,
    I am talking about 3rd senario, where we create one process on workbench, and pass filled pdf as input and then output of process is xml file.
    What is the process name here (Like renderPDF process) which extract data from pdf.
    regards
    Sunil

  • How to read the field type from field id of DynamicFldTbl

    Hi,
    In my application, i am using DynamicFldTbl, whch parses FML32 field table definition file. My field table definition file contains information about field names and its types.
    I checked the API of DynamicFldTbl and didn't find any API to get the field type from field it.
    Any way to read the field type from field id?
    Thanks in advance
    Raguraman

    Hi Raguraman,
    Once you have the field table, you can then create an FML32 buffer (TypedFML32) using the constructor that takes a field table, and then use the Fldtype() method on the specific field ID you wish to get the type of. I know this is sort of tedious and we should provide Fldtype() and some others on the field table class directly.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • How to read Choice Field values in a Formula of ohter shrepoint field

    Hi,
    i want to read choice field values(total values) in formula of other sharepoint calculated column field.
    Can anyone please help me.
    Thanks & Regards,
    Sandeep 

    Hi,
    According to your description, you might need to set the value of a column with the option from a Choice Field based on the value of another column(Site Column 1).
    The OOTB Calculated Formulas doesn’t provide such functionality to read the options of a Choice Field, we can do it via SharePoint JavaScript Client Object Model instead.
    Here is a documentation about SharePoint JavaScript Client Object Model :
    http://msdn.microsoft.com/en-us/library/office/hh185006(v=office.14).aspx
    An articel about using SharePoint JavaScript Client Object Model with steps in detail for your reference:
    http://social.technet.microsoft.com/Forums/en-US/2f679d4d-9aac-41ce-94a9-872ab258e30a/forum-faq-step-by-step-jsom-in-sharepoint-code-samples?forum=sharepointdevelopment
    Feel free to reply if there are still any questions.
    Best regards
    Patrick Liang
    TechNet Community Support

  • HOW to copy Form field from one RTF to another RTF

    Hi Expert
    I have developed 20 reports in BI Publisher which is using xml as data source. So to access the data i have done the xml coding for each form field.
    Now i want to copy the form field from one rtf to another, while doing the copy paste of the form field from one rtf to another it is not copying the xml coding. It is appearing in the new rtf as below
    <?ref:xdo0391?>
    Can you guys suggest me how to achieve the same. Is there any setting need to be changed so that while do the copy paste the form field it will copy the backend code also.
    Thanks in advance.
    Thanks
    Srikant

    make your template set as backward compatabile before you do anything on template. load the xml and then copy the form field. it should work. dont try to open the field without loading xml.

  • How to read the data from a file in another computer with user name and password login

    How to read read the data from a file in anohter computer which need to login with user name and password?

    duplicate post:  http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2061478
    duplicate post:  http://forums.ni.com/t5/LabVIEW/do-need-to-enter-the-user-name-and-password-when-TCP-ip/m-p/2061612
    duplicate post   http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2060682

  • How to read a binaryfile into an object

    Hello,
    I want to read a binary file into an object. In this object, we have
    several variables which need to be filled. I did the following thing:
    ---Start code---
    import java.io.*;
    import java.lang.reflect.*;
    public class BinaryFile {
      private File file;
      private DataInputStream dis;
      public BinaryFile() {}
      // Open the file
    public void openFile(String file) throws FileNotFoundException {
        this.file = new File(file);
        if (! this.file.exists())
          throw new FileNotFoundException();
        dis = new DataInputStream(new FileInputStream(this.file));
      // Close the file
      public void closeFile() throws IOException {
        dis.close();
    public void readObject(int offset, Object o) throws EndOfFileException,
                           IOException {
        // Get the fields in the object
        Field[] fields = o.getClass().getFields();
        try {
          String type, naam;
          Class className;
          int lengte, arrayLengte;
          boolean isArray;
          for (int i = 0; i !< fields.length; i++) {
            naam = fields.getName(); // Get the name of the field
    className = fields[i].getType(); // Get the type
    type = className.getName(); // Get the name of the type
    isArray = className.isArray(); // Is it an array?
    arrayLengte = 1;
    fields[i].setAccessible(true); // For setting the values
    if (isArray) {                      // If it is an array,
    type = getType(type); // decode it
    // Get the size of the array
    arrayLengte = Array.getLength(fields[i].get(o));
    // Determine the type of the variable and fill it.
    // Char
    if (type.equalsIgnoreCase("char")) {
    lengte = 1;
    if (isArray)
    fields[i].set(o, readChars(arrayLengte * lengte));
    else
    fields[i].setChar(o, readChar());
    // Byte
    } else if (type.equalsIgnoreCase("byte")) {
    lengte = 1;
    if (isArray)
    fields[i].set(o, readBytes(arrayLengte * lengte));
    else
    fields[i].setByte(o, readByte());
    // Short
    } else if (type.equalsIgnoreCase("short")) {
    lengte = 2;
    if (isArray)
    fields[i].set(o, readShorts(arrayLengte * lengte));
    else
    fields[i].setShort(o, readShort());
    // Int
    } else if (type.equalsIgnoreCase("int")) {
    lengte = 4;
    if (isArray)
    fields[i].set(o, readInts(arrayLengte * lengte));
    else
    fields[i].setInt(o, readInt());
    // Float
    } else if (type.equalsIgnoreCase("float")) {
    lengte = 4;
    if (isArray)
    fields[i].set(o, readFloats(arrayLengte * lengte));
    else
    fields[i].setFloat(o, readFloat());
    // Long
    } else if (type.equalsIgnoreCase("long")) {
    lengte = 8;
    if (isArray)
    fields[i].set(o, readLongs(arrayLengte * lengte));
    else
    fields[i].setLong(o, readLong());
    // Double
    } else if (type.equalsIgnoreCase("double")) {
    lengte = 8;
    if (isArray)
    fields[i].set(o, readDoubles(arrayLengte * lengte));
    else
    fields[i].setDouble(o, readDouble());
    catch (IOException ioex) {
    throw ioex;
    catch (Exception ex) {
    ex.printStackTrace();
    // Methods for reading from the DataInputStream
    private char[] readChars(int lengte) throws IOException {
    char[] c = new char[lengte];
    for (int i = 0; i < c.length; i++)
    c[i] = dis.readChar();
    return c;
    private char readChar() throws IOException {
    return dis.readChar();
    private byte[] readBytes(int lengte) throws IOException {
    byte[] b = new byte[lengte];
    for (int i = 0; i < b.length; i++)
    b[i] = dis.readByte();
    return b;
    private byte readByte() throws IOException {
    return dis.readByte();
    private short[] readShorts(int lengte) throws IOException {
    short[] s = new short[lengte];
    for (int i = 0; i < s.length; i++)
    s[i] = dis.readShort();
    return s;
    private short readShort() throws IOException {
    return dis.readShort();
    private int[] readInts(int lengte) throws IOException {
    int[] i = new int[lengte];
    for (int j = 0; j < i.length; j++)
    i[j] = dis.readInt();
    return i;
    private int readInt() throws IOException {
    return dis.readInt();
    private double[] readDoubles(int lengte) throws IOException {
    double[] d = new double[lengte];
    for (int i = 0; i < d.length; i++)
    d[i] = dis.readDouble();
    return d;
    private double readDouble() throws IOException {
    return dis.readDouble();
    private float[] readFloats(int lengte) throws IOException {
    float[] f = new float[lengte];
    for (int i = 0; i < f.length; i++)
    f[i] = dis.readFloat();
    return f;
    private float readFloat() throws IOException {
    return dis.readFloat();
    private long[] readLongs(int lengte) throws IOException {
    long[] l = new long[lengte];
    for (int i = 0; i < l.length; i++)
    l[i] = dis.readLong();
    return l;
    private long readLong() throws IOException {
    return dis.readLong();
    // If it is an array, decode it. The type will be "[x" where x is
      // translated according to the table
      private String getType(String type) {
              BaseType Character  Type  Interpretation
              B  byte  signed byte
              C  char  Unicode character
              D  double  double-precision floating-point value
              F  float  single-precision floating-point value
              I  int  integer
              J  long  long integer
              L<classname>;  reference  an instance of class <classname>
              S  short  signed short
              Z  boolean  true or false
              [  reference  one array dimension
        int arrayIndex = type.indexOf("[");
        if (arrayIndex != type.lastIndexOf("[")) {
          System.out.println("Multiple arrays not supported!");
          return type;
    char tempType = type.charAt(arrayIndex + 1);
    switch (tempType) {
    case 'B':
    type = "byte";
    break;
    case 'C':
    type = "char";
    break;
    case 'D':
    type = "double";
    break;
    case 'F':
    type = "float";
    break;
    case 'I':
    type = "int";
    break;
    case 'J':
    type = "long";
    break;
    case 'S':
    type = "short";
    break;
    default:
    System.out.println("Couldn't define this type: " + type);
    type = type;
    break;
    return type;
    ---End code---
    Now the problem. I want to read the header of an executable. I turn to
    the file format as described in WINNT.H. If it is a char, it will read
    ok. For everything else, it doesn't work. A WORD (= short in java) for
    instance, doesn't come up with the real value.
    The purpose of this piece of code is to emulate the structs that are
    used in C.
    What is the problem here and what is the solution?

    before coding a long class, look at Serialization mechanism in java
    maybe (or maybe not) it should be a better soution ...

  • How to move 1 field from 1 region to another region of same page persnaliz

    dear friends,
    i m geting some problem reagrding the Oracle Apps personalization. i dont have much more knowledge about personalization of OA Framework. i want to change one field from one region to another region of the same page. can u please guide me regarding this.
    as per my knowledge i have to create the new item from personalization and the bind that item with the view object. but i dont know how to that exactly. i m geting problem to find the name of that perticular view which belongs to that perticular field.
    so can u please tell me step by step how to do that, as i m beginer in this modual..
    thanx in addvance
    shailesh

    Shailesh,
    You can hide (Render = false) for first field in 1 region using personalization.
    You can create new item in IInd region and bind with View Object.
    Question : I m geting problem to find the name of that perticular view which belongs to that perticular field.
    Ans : Check the whether you are able to get ViewInstance and ViewAttribute Name from 1 field.
    Thanks, Avaneesh

  • How to read the field value from Table Control

    Hello Experts,
    I am creating my first Table Control Screen. Basically I have to create a screen (102) with a table control which has 2 fields: A_QTY, B_QTY and 2 Buttons: SAVE, EXIT.
    When Clicked on 'SAVE' the data (MATNR) from a previous screen (101)  and the data (A_QTY, B_QTY) from the new screen (102) should be saved into a Z-table.
    Internal table t_data has 3 fields.
    MATNR
    A_QTY
    B_QTY.
    Table Control TC_RACK was declared like this:
    controls tc_rack type tableview using screen 0102.
    I/0 Fields:
    A_QTY type ZQTY.
    B_QTY type ZQTY.
    The screen Flow Logic:
    process before output.
    module status_0102.
      loop at t_data into w_data with control tc_rack.
      endloop.
    process after input.
      module exit_0102 at exit-command.
      loop at tc_rack.
      endloop.
    module user_command_0102.
    module status_0102output.
      set pf-status 'STATUS_102'.
      set titlebar 'TITLE_102'.
      describe table t_rack lines tc_rack-lines.
    endmodule.                 "status_0102 output
    process after input.
    module user_command_0615 input.
    case ok_code.
       when 'SAVE_RK'.
       when others.
    endcase.
    endmodule.                 "user_command_0102 input
    Now for eg, when the users enter values for A_QTY and B_QTY like this:
    A_QTY     B_QTY
    1000         2000
    3000         4000
    How can I read these values and pass them to T_DATA so that I can save it into Z-table?
    I greatly appreciate your help.
    I've gone through some previously posted threads and could not understand because my knowledge in this area is preliminary.
    Thanks a lot.
    Could you please let me know
    Edited by: dev a on Jan 13, 2010 2:46 PM

    Hi dev a
    You should use
      DATA: lv_name(30) TYPE c.
      FIELD-SYMBOLS: <QTY> type ZQTY.
    GET CURSOR FIELD lv_name.   "Get the field name in table control
    check sy-subrc = 0.
    assign  (lv_name) to <QTY>.  "Here you get the value in <QTY>
    check sy-subrc = 0.
    Also use <your table control>-current_line to get the table index uo're currently on.
    Hint: Do not use GET CURSOR LINE if you want to get table index since this gives you the line relative to dialog screen
    Good luck
    Dean Q.
    Edited by: Dean Q on Jan 13, 2010 11:11 PM

  • Display read only field in table / form from another vo

    i came across couple of scenarios where i had to bring a field in a table / from from other vo than on which most fields in table / form were based. in all cases i had to display the field from another vo as read only and there was only one record in other vo which was related to previous vo in table / form. for this i created a view accessor and created a soc with model driven lov. the problem with this is that first element alwasy shows blank in soc. how can i display the filled soc with first element populated and read only in this scenario. i tried alternatively with groovy expressions but other people in team said it is not good practice to use groovy expressions to fill fields in one VO from other VO. how can i acheive this requirement with soc component / lov / view accessors. is there any other alternative as well. jdev 11 1 1 5

    1) in the attribute of the VO select the 'List of values' node and edit the list attribute you see there; in the dialog select the UI Hints tad and make sure the checkmark for the 'Include "no Selection Item' is off.
    2) you can base a VO on to EO which are then joined via one or more attributes (association)
    Timo

  • How to extract a field from Binary object

    Hi Guys,
    I have a Binary object in custom aggregator and I would like to extract a field from the Binary object without de-serializing the Binary object. I know this can be done but figure out how.. Appreciate your help.
    Have tried this
    PofValue value = PofValueParser.parse(Binary, (PofContext) BinaryEntry.getSerializer());
    PofValue child = value.getChild(1);
    Object value = child1.getValue();
    but no luck.
    Thanks
    D

    Hi JK,
    Thanks..  I have Binary  and tried
    PofValue pofValue = PofValueParser.parse(binary, pofContext);
    PofNavigator path = new SimplePofPath(1);
    PofValue target = path.navigate(pofValue);
    Object value = target != null ? target.getValue() : null;
    but no luck.. I must be missing something.
    Basically, am trying to do cache joins using aggregator and data affinity. Sample code snippet
    @Override
      public Object aggregate(Set values) {
      List extractedValues = new ArrayList();
      for (Map.Entry entry : (Set<Map.Entry>)values) { 
       try {
        //these are BinaryEntries in TESTCACHE1
        BinaryEntry binaryEntry = (BinaryEntry)entry;  
        Long compId = (Long)binaryEntry.extract(new KeyExtractor("getComponentId")); 
        Long contId = (Long)binaryEntry.extract(new KeyExtractor("getPartyId"));
        BackingMapContext backingMapContext = binaryEntry.getContext().getBackingMapContext("TESTCACHE2");  
        ObservableMap backingMap = backingMapContext.getBackingMap();
        MapIndex mapIndex = backingMapContext.getIndexMap().get(new KeyExtractor("getComponentId"));   
        com.tangosol.util.InflatableSet keySet = (com.tangosol.util.InflatableSet) mapIndex.getIndexContents().get(compId);
        Binary object = null;
        for(Object key : keySet ) { 
         object = (Binary)backingMap.get(key);    
        PofNavigator  path  = new SimplePofPath(2);
        PofValue value = PofValueParser.parse(object,  (PofContext) binaryEntry.getSerializer());
        PofValue  target = path.navigate(value);  
        Object extractedValue = target != null ? target.getValue(): null;
        extractedValues.add(extractedValue);
       } catch (Throwable t) {
        log.error("Exception in aggregate method ", t);
        throw new RuntimeException("Exception in aggregate method", t);
      return extractedValues;

Maybe you are looking for

  • Nvidia DVD Problems

    Nvidia and MacrovisionDoes anyone having problems with DVD players on Nforce systems and vga drivers above 40.72(Geforce 2 mx integrated)? When I play a dvd movie with Power DVD 5.0,a small window pops up alerting me that the movie can't run because

  • Itunes is wrongfully saying some songs have been authorized on more than 5 computers -- please help!

    Hi, can someone please help me.  ITunes is saying that some of my songs have been authorized on more than five laptops, which isn't true--it's not letting me play those songs, and I have no way of deauthorizing the accounts on three of my old laptops

  • How do I get rid of an Advertising pop up virus?

    I have an iMac running Yosemite.  I am having a problem with a virus that covers web pages with Advertising.  I ran Bitdefender Virus Scanner but the problem remains.  How do I get rid of this virus?  Thanks.

  • Out of memory error back in lightroom 1.3

    My wife likes to print lots of pictures on one page, like 8 to 16 typically. lately while printing instead of printing pictures, random frames wil be grey and read out of memory. the monitor displays the photo however. looking at the print jobs the p

  • Problem or Characterisc of EZ Media?

    I purchase one EZMED 1HDX2TB LA in brasil, on network of 1GB the manager web console is very slow...the hard disk light always ON but no have traffic!, after some time the hard disk make noise, have one software read hard disk full integral time?, no