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

Greetings,

I'm a student and in an exercise working with Oracle object-oriented programming features.

In the database, we have defined an object type, which is then considered as within another type of object. The thing is, that I can not read an attribute of the internal object. I've read dozens of Web sites, but none of them helped until now. I also read the PL/SQL user's Guide and the reference document.

The internal object is defined as follows:
create type address_t as object (
        street varchar(50),
        city varchar(50),
        pcode number(5,0)
        );
The external object has an object of type address_t inside:
CREATE TYPE professor_t as OBJECT(
          code number(2),
          p_name varchar(50),
          address address_t,
          );
There is also a table named PROFESSORS that stores objects of type professor_t

First of all, with a simple SQL test I can see the data inside the Professor of the object, even the address_t of the object:
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 saw everywhere where the way forward is to use dot notation, and I've seen examples of the VALUE control, 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 would appreciate if someone could show me how to access the values of the field of the object inside an object.

Thanks in advance,
-David

Published by: 858176 on May 11, 2011 18:53 formatting

Try this:

select value(t).address.city from profesores t;

http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/objects.htm#i12884

HTH
Thomas

Tags: Database

Similar Questions

  • How to exclude the field of persistent object

    Hello

    Is it possible to substitute the PersistanceStore method to persist objects?

    I have a complex data structure I need to store. One of the internal classes contain no persistent field. When I'm storing the data I don't no need to store this field, but the compiler triggers error.

    ... Widget: error! : class... Persistable marked widget by interface:... Persistable is not persistent: _field field: class... Field does not implement net.rim.vm.Persistable

    Is the way to override the implementation of this class persitant and exclude the problematic areas?

    Thanks for the reply.

    I did something similar, I created a class of data for persistence and a class of execution with additional fields.

    It's not very practical, these classes are deep into a tree of complex data, but I guess that's how it should work with BlackBerry.

  • How to read the value attribute and put inside?

    What happens if we want to read the attribute value? And want to put the data of runtime on the value of the attribute as

    < psoID ID = "user id" / >

    How to get the value of the ID as the user id. And how to put the run value on it?

    I can think about is that

    /psoID/@ID/value GOLD psoID/@ID/*[local-name () = 'value']

    And how to put the value inside ID ="? »

    Thank you

    Because we are dealing with a structure of type anyType you must use the functions of node (local name) in combination with predicates ([]) to read or write values (node) of the element:

    To read the value for example use the copy rule:




    This wil read:

    /processResponse/result/psoID/@ID

    on the message:





    You will see the value 'B '.

    To write, you use:




    Kind regards

    Melvin

  • How to read COM of DLL (Component object method) in Labview 8.6.1

    Hi all:

    Today, I found it difficult to read the COM (Component Object Method) in the DLL file in Labview. I've only managed to read a function exported in the dll file using the library call with Labview function block diagram, software programming. Please give me advice or solution to solve my current problem encounter. Thank you.

    The figure below is the way I recover the function of dll file. The function block manage only recover the function exported in the dll file.

    Hello

    I just want to share a solution that works for your problem:

    1. save the DLL in Windows
    -Go to \WINDOWS\system
    folder
    -Copy-paste your dll file in
    This file, TraceDataV28_test18.dll
    -Open the command prompt (cmd), go to the directory<>
    file > \WINDOWS\system
    and type REGSVR32
    'TraceDataV28_test18.dll '.

    -A pop-up window should appear to inform you that
    It has been registered

    2. use
    Node property/invoke:
    -Open
    LabVIEW
    -Drag and Drop invoke node to
    Range of functions > Application control > invoke node
    -Right click on it and Select
    Class > ActiveX > Browse...

    Find your DLL file, and you can choose what COM method you want
    use.

    Hope its helpful.

    Sincerely,

    Krisna

  • How to read the values of the field of LOV disabled?

    Hi all

    I have a requirement, based on values that we entered one of the LOV fields, then we are arising from the new values based on the value that we entered this field of LOV. And then I must by default new LOV values derived in a two other fields of LOV and then disable them. Once the fields are disabled, then I'm not able to read the values using the pagecontext.getparameter... I get nothing when I tried to read using the pagecontext.getparameter.

    Pointers on how to read the values of disabled field/LOV?

    Thank you
    Clarriiza

    1. you already have values, and that's what you set in the LOV before turning off, right? So why do you need to recover again from the LOV.

    2. are you disabling or making it readonly? I think that if it is disabled, you might still be able to get the value using pageContext.getParameter.

    3 have you tried to get the handle to the LOV bean and get the value using lovBean.getValue (pageContext)?

    4. another Option is to combine the value of a FormValue Bean also (as well as the LOV bean) and retrieve it from FormValue.

    5 BTW, why are, why you're seen LOV if you disable it? Can't you just a TextBox?

    See you soon

    AJ

  • How to disable the warning of validation on the calculation (read-only) field in the table

    Is it possible to add a line in a calculation script (JavaScript) that prevents a dialog box of a calculation field validation?

    Scenario:

    • Working with fields in a table inserted.
    • In each line, I have a couple of fields that the user has entered. These fields have a Validation model has allowed that the user must enter the data correctly.
    • There is a calculated field based on the data entered by the users. It is this field that throws a warning dialog box "the value entered for Total_Row1 is not valid. "To ignore the validations for Total_Row1, click on ignore.

    Even if I turn off the Model Validation on fields used for the calculation of the warning dialog box always appears. So, it seems to be isolated in the field of computing.

    The calculation area displays the time and I got it originally set as a Date/time field, but also tried to use a text field (as the calculation should appear as 0:45 for 45 minutes in this area).

    I have a suspicion that the warning appears only because I used an array for formatting fields, as I used similar validation profiles and other calculation fields and see not the message when the fields do not appear inside the table.

    I think of easier workaround would be to disable validation for this particular calculation field, but I have no idea how the script that. Any help appreciated lot.

    CARI

    I discovered the problem.  In a word: it was a mistake by naming the fields.

    • I have fields named with line numbers in the field name (for example FieldName_Row1).
    • and fields calls with FieldName_Row1.formattedVallue must have triggered some confusion.

    As soon as I removed the word 'Row' of file names, the question of the warning dialog validation mystery Adobe Acrobat for the calculation field have disappeared.

    Ago about 3-4 hours of my life that I won't be back... ha - ha but if someone else has the problem, I thought I better share my discoveries

  • How to read pdf form data/fields

    Hello

    I want to orchestrate a process where the entrance is formed interactive and is the xml data output.

    I mean that I want to read/data fields of the pdf form.

    What activity are used on bench.

    Concerning

    Sunil

    Try the ExportData or ProcessFormSubmission service.

    I hope that helps!

    Vikas - Vijayrania

  • How to set a field in a form of DML to only display?

    It seems that it would be obvious, but I can't figure out how to set a field in a DML form read-only.  Thanks for all the ideas.

    The most obvious thing is to define the type of item to display only. Save Session State to Yes if the value of the item is required in after not submit treatment or if the value is only for display on the page.

    Alternatively, if you want the element to appear as a normal text control, but do not be modifiable, set the item text field and the custom attributes type to readonly .

  • In CloverETL how to read file xlsx with a column of type "long".

    Hi all

    Let me know how to read an xlsx (Excel) file with columns of data type "long".

    I used XLSDataReader to read file xlsx. There are names of "Remarks" column, which exceeds the linits of 256 characters, so I can not use type 'string' to do this.

    IM using "long" datatype and graph below error crossings.

    Pointers on this will be greatly appreciated.

    INFO [main] - * graphic CloverETL framework/transformation, (c) 2002-2013 Javlin a.s., published under the GNU Lesser General Public License *.
    [Main] INFO - running with CloverETL library version 3.4.1 build #010 updated 07/01/2013 18:38:12
    INFO [main] - running on 4 CPUS, operating system Windows 7, architecture amd64, Java version 1.7.0_07, max memory available for JVM 913920 KB
    INFO [main] - loading properties by default: defaultProperties
    INFO [main] - graphic definition file: graph/SurveyResponses.grf
    INFO [main] - graphical revision: 1.16 modified by: 470707 update the: kill Jan 20 16:13:52 IST 2015
    INFO [main] - check the graphical configuration...
    INFO [main] - graphical configuration is valid.
    INFO [main] - graphical initialization (SurveyResponses)
    INFO [main] - initialization of the phase 0
    INFO [main] - Phase 0 initialized successfully.
    INFO [WatchDog_0] - starting all the nodes in the phase [0]
    INFO [WatchDog_0] - has successfully started all nodes in phase!
    INFO [XLSDATA_READER1_0] - reading data of 0 sheet (Sheet1).
    ERROR [WatchDog_0] - component [XLSDataReader:XLSDATA_READER1] finished with ERROR status.
    How (long) field cannot be set to the value "comment." does not match the specified format ' ' with good reason 'incomplete analysis. " in folder 1, 23 ("comment"), metadata field 'Survey_Responses_Sheet1 '; value: 'How' (note that for parallel processing ParallelReader or server, run the registration number may be incorrect)
    ERROR [WatchDog_0] - the error Details:
    org.jetel.exception.JetelRuntimeException: component [XLSDataReader:XLSDATA_READER1] finished with ERROR status.
    at org.jetel.graph.Node.createNodeException(Node.java:535)
    at org.jetel.graph.Node.run(Node.java:514)
    at java.lang.Thread.run(Thread.java:722)
    Caused by: org.jetel.exception.BadDataFormatException: how (long) field cannot be set to the value "comment." does not match the specified format ' ' with good reason 'incomplete analysis. " in folder 1, 23 ("comment"), metadata field 'Survey_Responses_Sheet1 '; value: 'How' (note that for parallel processing ParallelReader or server, run the registration number may be incorrect)
    at org.jetel.data.LongDataField.fromString(LongDataField.java:465)
    at org.jetel.data.parser.XLSXDataParser.parseNext(XLSXDataParser.java:492)
    at org.jetel.data.parser.XLSParser.getNext(XLSParser.java:136)
    at org.jetel.util.MultiFileReader.getNext(MultiFileReader.java:432)
    at org.jetel.component.XLSReader.execute(XLSReader.java:562)
    at org.jetel.graph.Node.run(Node.java:485)
    ... 1 more
    Caused by: java.lang.NumberFormatException: incomplete analysis
    at javolution.text.TypeFormat.parseLongString (unknown Source)
    at javolution.text.TypeFormat.parseLong (unknown Source)
    at javolution.text.TypeFormat.parseLong (unknown Source)
    at javolution.text.TypeFormat.parseLong (unknown Source)
    at org.jetel.util.formatter.JavolutionNumericFormatter.parseLong(JavolutionNumericFormatter.java:74)
    at org.jetel.data.LongDataField.fromString(LongDataField.java:462)
    ... 6 more

    INFO [WatchDog_0] - the implementation of phase [0] completed with error - elapsed time (sec): 4
    ERROR [WatchDog_0] -! Completed with error - graphic stop run!
    INFO [WatchDog_0]-* the summary execution of Phases * -.
    INFO [WatchDog_0] - Phase # finished status RunTime (sec) MemoryAllocation (KB)
    INFO [WatchDog_0] - 0 4 175279 ERROR
    INFO [WatchDog_0]-* end of summary * -.
    INFO [WatchDog_0] - finished the watchdog thread - total running time: 4 (s)
    INFO [main] - freeing graphics resources.
    ERROR [main]-
    --------------------------------------------------------------------------------------------------------------------------------------------------------- Error details ----------------------------------------------------------------------------------------------------------------------------------------------------------
    Component [XLSDataReader:XLSDATA_READER1] finished with ERROR status.
    How (long) field cannot be set to the value "comment." does not match the specified format ' ' with good reason 'incomplete analysis. " in folder 1, 23 ("comment"), metadata field 'Survey_Responses_Sheet1 '; value: 'How' (note that for parallel processing ParallelReader or server, run the registration number may be incorrect)
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    ERROR [main] - the graph failed!

    I think the 256 character limit is a red herring.  All data is there, the front-end integrator is truncating only for display purposes.

    Your data is a string, it should certainly be classified as a string in the metadata.  For a long time is for numeric values.

    I don't think there is a problem here, if you were to write this data to the trash or a text file (after reading it in), you will see that your data is not truncated.

    Kind regards

    Patrick Rafferty

    Branchbird

  • Save event - make text read-only field if not empty

    I have a document which must have read only 1 field if it is not empty when the form is saved. I have the Document Actions 'spared' configured to run a script that contains only:

    getField("DepositDue").readonly = true;

    The problem is, if I save the document so that it can be filled and saved by adobe reader, this field is changed to read-only. What I need is an if statement to check if this field is empty first, but do not know how to do in this regard. The extered text is a date in the format of date as well.

    The following works for me in paper will save the event, but not the Document spared:

    var f = getField ("DepositDue");

    f.ReadOnly = f.valueAsString;

  • How to take a field value in a table?

    How to take a field value in a table? its urgent...

    I recommend you read up a bit on JS. These are standard questions that are not

    associated with Acrobat, as such.

    I recommend this site: http://www.w3schools.com/js/default.asp

    Specifically, to answer your question, you can use the join() method.

    See here: http://www.w3schools.com/jsref/jsref_join.asp

    You can then convert this string to a number using the number I

    described previously.

  • How do the text field of the script on a master page to show a total of retail

    I'm trying to become familiar with LiveCycle Designer and need to know how to have the fields on the master page to reflect the detail for each page totals, then a master total at the end. It's for printing only output so I guess that the script should run on the server, because I saw this option.

    Another question: where can I find documentation for this so I can read other things myself? I have difficulties to find a path to what I need on the Web site. Thank you

    It can be done, but it implies some level of script. I was going to create a sample for you but thought that it would be easier to your screen. If you provide I'll put something together for you. Make sure you incode I can work with a data file.

    If you want to try it on your own, here is a post that describes:

    http://forums.Adobe.com/message/1360007#1360007

    Paul

  • How to read instance information

    I write my code of studio and then deploying it in the engine.

    Can someone paste me code that I can use in the studio for information on bodies that have been created under any role.

    I saw a few APIs, but they need the instance id. Not sure how I can get the instance id

    Please advice.

    Hello

    Sorry, I wasn't clear on what it means to you by is:

    .. get information on instances that have been created under any role

    Here are some examples to get a list of instances, but displays no information on the role. I don't know what kind of information you're looking for the role.

    This first example is logic that assumes that you want to watch some instances based on a search filter. In this example, the filter is based on the type of customer they are for example ("Gold", "Platinum", "Silver"). It returns only cases currently in process (the logic of SearchScope below being set to "StatusScope.ONLY_INPROCESS" in the logic below). The incoming variable only she needs is the variable "customerType" which has already been set to a value. Note that this example uses the Fuego.Papi.ClientBusinessProcess object. This logic creates a search filter and returns only cases that meet certain criteria (for example a job active element instances that have the customer type 'Or'):

    cbp as ClientBusinessProcess = ClientBusinessProcess()
    
    connectTo(cbp, processId : "/NameOfYourProcessHere")
    
    instF as InstanceFilter = InstanceFilter()
    
    create(instF, processService : cbp.processService, viewId : "TypeSearch")
    
    instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS)
    
    logMessage "Customer Type is: " + customerType  using severity = DEBUG
    
    // the variable "customerType" is a String variable set to "Gold", "Silver", "Platinum" in the process
    addAttributeTo(instF, variable : "customerType", comparator : IS, value : customerType)
    
    for each inst in getInstancesByFilter(cbp, filter : instF) do
       // get the value of the order's amount for the instance
        instanceVarValue as Object = getVar(inst, var : "orderAmount")
    
        logMessage "amount is: " + Decimal(instanceVarValue)  using severity = DEBUG
    end
    

    Here is a second example which I suppose is perhaps closer to what you are looking for. Once again, this has nothing to do with the roles that you said you were interested, but does not return the list of work item instances that are in their special properties. Also note that it uses a different technique to connect - the Fuego.Papi.BusinessProcess object. This logic assumes that you have already created a participant ('auto') that has been assigned a role in the process. It also assumes that you run this by a method inside the process - this is the reason why the predefined variable "process.name" works here. If you use it, be sure to use the id of the activity and not the name. Id is what see you when you right mouse click on an activity in a process-> 'Properties' and look read only field "activity Id". Do not use the name field which usually has white space in it for this logic.

    bp as BusinessProcess
    targetActivity as String
    
    connectTo bp
        using url = Fuego.Server.directoryURL,
              user = "auto",
              password = "auto",
              process = "/" + process.name
    
    logMessage "Connected to: " + process.name using severity = DEBUG
    
    // get the list of instances in a specific activity
    for each instance in getInstancesByActivity(bp, activity : "QueueWaitingForDistribution") do
    
        logMessage "found an instance with the value: " + String(getVar(instance, var : "someVariableNameHere")) using severity = DEBUG
    
    end
    
  • ORA-22905

    *
    DECLARE


    TYPE t_result_set IS REF CURSOR;

    *

    v_result t_result_set;


    v_accnt_nbr VARCHAR2 (20);


    v_sql VARCHAR2 (1000);

    *
    BEGIN


    v_accnt_nbr: = '000000029674';

    * Open V_result * for*.
    SELECT * From Table(f_get_accnt_list('000000029674'));

    * END; *

    This part works very well if the required input function is hardcoded.
    -------------------------------------------------------------------------------
    **
    DECLARE


    TYPE t_result_set IS REF CURSOR;

    *
    v_result t_result_set;


    v_accnt_nbr VARCHAR2 (20);


    v_sql VARCHAR2 (1000);

    *
    BEGIN


    v_accnt_nbr: = '000000029674';

    * Open V_result * for*.
    SELECT * From Table(f_get_accnt_list (v_accnt_nbr));

    **
    END;
    * This survey error ORA-22905 if hard-coded entry is replaced as indicated
    * Can you please explain? </p

    Published by: [email protected] on March 16, 2009 13:10

    Hi victory.

    You cannot use ' * ' in Oracle 9, however Oracle 10 this is solved

    ----------------------------------------------------------------
    Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
    PL/SQL Release 9.2.0.5.0 - Production
    CORE     9.2.0.6.0     Production
    
    CREATE TABLE TEST ( ID NUMBER
                      , ENAME VARCHAR2(100)
                      , HIREDATE DATE );
    
    INSERT INTO TEST VALUES (1,'AAA',SYSDATE);
    INSERT INTO TEST VALUES (1,'BBB',SYSDATE);
    INSERT INTO TEST VALUES (1,'CCC',SYSDATE);
    
    CREATE TYPE MYOBJ AS OBJECT( ID NUMBER
                               , ENAME VARCHAR2(100)
                               , HIREDATE DATE );
    
    CREATE TYPE MYTABLE IS TABLE OF MYOBJ;
    
    DECLARE
      CURSOR MYCURSOR IS
        SELECT ID, ENAME, HIREDATE FROM TEST;
    
      VT_MYTYPE  MYTABLE;
      V_ID       NUMBER;
      V_ENAME    VARCHAR2(100);
      V_HIREDATE DATE;
      V_CURSOR   SYS_REFCURSOR;
    BEGIN
      VT_MYTYPE := MYTABLE();
    
      OPEN MYCURSOR;
      LOOP
        FETCH MYCURSOR
          INTO V_ID, V_ENAME, V_HIREDATE;
        VT_MYTYPE.EXTEND;
        VT_MYTYPE(VT_MYTYPE.COUNT) := MYOBJ(V_ID, V_ENAME, V_HIREDATE);
    
        EXIT WHEN MYCURSOR%NOTFOUND;
      END LOOP;
      CLOSE MYCURSOR;
    
      OPEN V_CURSOR FOR
        SELECT *  -----> ORA-22905: cannot access rows from a non-nested table item
         FROM TABLE(VT_MYTYPE);
    END;
    
    DECLARE
      CURSOR MYCURSOR IS
        SELECT ID, ENAME, HIREDATE FROM TEST;
    
      VT_MYTYPE  MYTABLE;
      V_ID       NUMBER;
      V_ENAME    VARCHAR2(100);
      V_HIREDATE DATE;
      V_CURSOR   SYS_REFCURSOR;
    BEGIN
      VT_MYTYPE := MYTABLE();
    
      OPEN MYCURSOR;
      LOOP
        FETCH MYCURSOR
          INTO V_ID, V_ENAME, V_HIREDATE;
        VT_MYTYPE.EXTEND;
        VT_MYTYPE(VT_MYTYPE.COUNT) := MYOBJ(V_ID, V_ENAME, V_HIREDATE);
    
        EXIT WHEN MYCURSOR%NOTFOUND;
      END LOOP;
      CLOSE MYCURSOR;
    
      OPEN V_CURSOR FOR
        SELECT ID
             , ENAME
             , HIREDATE
         FROM TABLE(VT_MYTYPE);
    END;
    
    PL/SQL procedure successfully completed
    

    declare all fields when to return the cursor.

    Kind regards

    Christian Balz

  • I need to know how to read my DVDs on quick time with an extension xvid.avi

    I need to know how to read my DVDs on quick time with an extension xvid.avi

    You have not because QuickTime Player does not support the xvid .avi formats or dvi. You can download the free VLC media player and she plays very well this .avi.

Maybe you are looking for

  • Skype ATM Compenation

    I feel silly even curious about it, but I was contacted via Skype yesterday on ATM Compensation for being a victim "scammed" and that I am to receive $150,000 USD. This is the message that they sent by e-mail, as well: "Congratulations to join Skype!

  • Can I put a double click my mouse from Apple?

    Over the years, I've used many third-party mouse, but now in part because of problems of drivers with this mouse, I would give the Apple mouse that I got with my newish iMac to try. But I'm really used to having the number of right mouse button doubl

  • quadrant ICS pre and post scores

    I would be interested in your pre - ICS and ICS-post on Quadrant Standard scores. I get between 2800 and 3000 on the MAXX, I think that you guys will get even, maybe even better. Also I was wondering if anyone of you has moved to 1 .2GHz now on ICS.

  • Compaq Presario start button problem

    I have a problem with the Start button on the Tower on my Compaq Presario SR1879UK Tower. When I pressed the button start on the PC Tower didn't, but the light that surrounds the button start flashed constantly. I tried to press the button to turn it

  • Backlight keyboard HP Pavilion dv6-6b96ex

    Hello I need to ask questions about my backligh of laptop keyboard (HP Pavilion dv6-6b96ex), a know if my laptop work backlight keyboard or not? I try every thing to turn on the key board but it does not work! any help, please