Select / extractValue and Datatype

Database: Oracle 9.2.0.1.0
I am selecting from "XML Schema Validating" data stored in column of XMLTYPE datatype.
SELECT
extractvalue(value(t), '/path1/element1') DateVal1,
extractvalue(value(t), '/path1/element2/@attribute') Date2
FROM XML_TABLE A,
TABLE (
xmlsequence (extract(A.XML_COLUMN,'path0/path1'))) t;
Returned values DateVal1, Date2 are strings and not of date datatype. Registered schema for the above element and attribute is of date datatype. How can I retain datatype in my select statement?
Any additional input will be appreciated.

Please see thread at
any relationship between extractvalue's return type and sqltype?

Similar Messages

  • Select extractValue returns nothing - HELP!

    My xml document in my XMLType table looks like this:
    <echoems:ECHOMetrics xmlns:echoems="http://(myhost)/(myfilename.xsd)" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://(myhost)/(myfilename.xsd) http://(myhost)/(myfilename.xsd)">
    <OrderMetrics>
    <OrderItemMetric>
    <submissionDateTime>2001-12-31T12:00:00.000000</submissionDateTime>
    <requestor>123.456.789.000</requestor>
    <product>MYD09Q1</product>
    </OrderItemMetric>
    </OrderMetrics>
    </echoems:ECHOMetrics>
    My query is:
    select extractValue(object_value, '/ECHOMetrics/OrderMetrics/OrderItemMetric/product') from echoxml;
    However, I keep getting an emtpy result. What am I doing wrong?

    One other question. I've searched the forum on XMLTable and can't find what I'm looking for. Using my xml file below, how can I use XMLTable to get the data and column names into a relation table or view? I've tried the following but get no rows returned:
    SELECT echo2."product"
    FROM echoxml,
    XMLTABLE('/ECHOMetrics'
    PASSING extract(object_value,'echoems:ECHOMetrics/OrderMetrics/OrderItemMetric/*','xmlns:echoems="http://(myhost)/emslogsDEV/error/(myfilename.xsd)')
    COLUMNS
    "product" varchar2(85) PATH '/ECHOMetrics/OrderMetrics/OrderItemMetric/product')
    echo2;
    Here's my document:
    <echoems:ECHOMetrics xmlns:echoems="http://(myhost)/(myfilename.xsd)" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://(myhost)/(myfilename.xsd) http://(myhost)/(myfilename.xsd)">
    <OrderMetrics>
    <OrderItemMetric>
    <submissionDateTime>2001-12-31T12:00:00.000000</submissionDateTime>
    <requestor>123.456.789.000</requestor>
    <product>MYD09Q1</product>
    </OrderItemMetric>
    </OrderMetrics>
    </echoems:ECHOMetrics>

  • ExtractValue and witespace

    Hello!
    I have an xml like this:
    <file>
       <fieldend>'||chr(13)||chr(10)||'</fieldend>
    </file>and when i select it:
    select '"'||ExtractValue(XMLType('<file><fieldend>'||chr(13)||chr(10)||'</fieldend></file>'),
                             'file/fieldend/text()')||'"' "fieldend"
      into sFieldEnd
      from duali have just:
    ""I run it in pl/sql procedure and select it into the string variable, i expect in my string chr(13)||(10).
    How can i get in sFieldEnd value chr(13)||chr(10) ?

    Why not do something like
    declare
      v_mystring varchar2(4000);
      sFieldEnd varchar2(4000);
    begin
      v_mystring := ' ''||chr(13)||chr(10)||'' ';
      sFieldEnd := v_mystring;
      execute immediate ....etc etc etc
    end;
    /(pseudo code)

  • Selecting a Long datatype

    I have created a select statement and saved it to the variable sql_str. I then Open the cursor "OPEN v_cursor FOR sql_str;".
    One of the columns in the select statement has a datatype of LONG. I fetch the column into a variable that I have declared as Long. I get the following error: ORA-00997: illegal use of LONG datatype.
    What am I doing wrong?

    One of the columns in the select statement has a datatype of LONG. I fetch the column into a variable that I have declared > as Long. I get the following error: ORA-00997: illegal use of LONG datatype.
    What am I doing wrong?What are you doing differently:
    SQL> desc user_views
    VIEW user_views
    Name                                      Null?    Type                       
    VIEW_NAME                                 NOT NULL VARCHAR2(30)               
    TEXT_LENGTH                                        NUMBER(0)                  
    TEXT                                               LONG                        <-- Long
    TYPE_TEXT_LENGTH                                   NUMBER(0)                  
    TYPE_TEXT                                          VARCHAR2(4000)             
    OID_TEXT_LENGTH                                    NUMBER(0)                  
    OID_TEXT                                           VARCHAR2(4000)             
    VIEW_TYPE_OWNER                                    VARCHAR2(30)               
    VIEW_TYPE                                          VARCHAR2(30)               
    SUPERVIEW_NAME                                     VARCHAR2(30)               
    EDITIONING_VIEW                                    VARCHAR2(1)                
    READ_ONLY                                          VARCHAR2(1)                
    SQL> declare
       t   long;
    begin
       for c in (select text from user_views where rownum = 1)
       loop
          t := c.text;
          dbms_output.put_line (t);
       end loop;
    end;
    SELECT
        "LIB_DYN_QUERY_ID" AS "LIB_DYN_QUERY_ID"
       ,"LIB_DYN_QUERY_NAME" AS "LIB_DYN_QUERY_NAME"
       ,"LIB_DYN_QUERY" AS "LIB_DYN_QUERY"
       ,"CREATED_ON" AS "CREATED_ON"
       ,"CREATED_BY" AS "CREATED_BY"
      FROM
        "UT_LIB_DYN_QUERIES"
      WITH READ ONLY
    PL/SQL procedure successfully completed.?

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • Diff b/w select endselect and select into table............

    what is the difference b/w
    Select
    Endselect
    and select into table....
    Akshitha..

    Hi,
      When ever u want to append data into the workarea then use select ... endselect. When u r appending data into the internal table then use select. Also when u use select single then also use only select.
    Eg: Using only Select
    data : begin of itab occurs 0,
    lifnr like lfa1-lifnr,
    end of itab.
    select single lifnr from lfa1 into itab.
    data itab like lfa1 occurs 0 with header line.
    select * from lfa1 into table itab.
    Eg: Using Select .. endselect.
    data : itab like lfa1 occurs 0,
    wa like lfa1.
    select * from lfa1 into wa.
    append wa to itab.
    endselect.
    Regards

  • XML extractvalue and NULL result-Problem

    I've got a very strange problem: One select gets restults in my development-database, the same select in production retrieves NULL.
    The following sql-construct:
    SELECT (
      CASE
        WHEN personkey!=-1
        THEN
          ( SELECT extractvalue( v.xml, '/p:PersonData/p:TypedPostalAddress[@id="' ||<string> || '"]/p:PostalAddress/p:PostalCode', .....')
          FROM <tbl1>,<tbl2>
          WHERE tbl1.id=tbl2.id)
        ELSE
          ( SELECT 'no person' FROM dual )
      END ) adress,
    FROM <tbl3>
    WHERE <tbl3>.personkey!=-1
    When I use a view containing an outer join in the ELSE-Condition of the case I'm not getting a result in production, but I do in development (same data, same oracle-version, but other instance), but when I use a view without an outer join in the else-Condition, I'm getting results also in production. The column "personkey" is not nullable.
    Does anyone got an idea what could be wrong with this SQL?
    Thanks in advance for help!

    Additional Information:
    When resolving the CASE to a "union all" query, I am having the following result:
    query1 is working
    query2 is working
    joining both queries with union all => the result of the first query (with the extractvalue) is NULL, the second query is still working.

  • Select all and deselect all in table control

    Hi experts,
        I want to make the select all and deselect all options in my table control.
    But i can't able to do that one. Kindly suggest me how to do that one.
    one more thing, if i select some rows in the table control, and press save it should be saved in some other table. how can i implement that one.
    Waiting for ur reply.
    Regards...
    Arun.

    Hi Arun,
    In the context node that you bind to the table, set the cardinality as 0..n and selection as 0..n. In the UI element Table, set the property selectionMode as 'multi'. Then a toggle button for select/deselect all will appear automatically in your table. You can see it in the top left corner.
    For your second question, after selecting the elemets and pressing 'save', in your event handler, do a get_selected_elements( ) on your node. This will return you a set of context elements. Loop through each element and do a get_static_attributes to get the rows. Then you can append these rows to another internal table and bind it to the context. Bind your second table to this node. If the two tables are in different views, the context nodes need to be present in the component controller and mapped to the views.
    Hope this helps.
    Regards
    Nithya

  • Could you please tell me why as a Brit resident in Japan therefore having a billing address that is Japanese is forced to only get service from the Japanese online store? Is there not some way of allowing me to select movies and music to buy and download

    Could you please tell me why as a Brit resident in Japan therefore having a billing address that is Japanese is forced to only get service from the Japanese online store? Is there not some way of allowing me to select movies and music to buy and download from other stores. Why do am i forced to try to nread Japanese when I have selected English as my language. The price for Downloads is no different and even if it was I am happy to pay. This also applies to Movie rental which is crazy and extremely restrictive. I a supposed GLOBAL community why does Apple do this.

    You can buy ONLY from the itunes store of your country of residence (As proven by valid billing address of credit card) and ONLY while inside the borders of that country.
    These are the terms of the itunes store.

  • After download and installation of PS PE12 I have problems starting the programm. After selecting video and new project nothing happens, only the colorbar below new project is showing

    New computer.
    After download and installation of PS PE12
    I have problems starting the programm, double clicking on the icon.
    After selecting video and new project nothing happens, only the colorbar below new project is showing, nothing happens.
    (expected was to activate the program and the sarting the PE12)
    PSE12 runs fine
    System:
    WIN8.1 / i7 /16GB RAM

    New computer.
    After download and installation of PS PE12
    I have problems starting the programm, double clicking on the icon.
    After selecting video and new project nothing happens, only the colorbar below new project is showing, nothing happens.
    (expected was to activate the program and the sarting the PE12)
    PSE12 runs fine
    System:
    WIN8.1 / i7 /16GB RAM

  • Bind Variable in SELECT statement and get the value  in PL/SQL block

    Hi All,
    I would like  pass bind variable in SELECT statement and get the value of the column in Dynamic SQL
    Please seee below
    I want to get the below value
    Expected result:
    select  distinct empno ,pr.dept   from emp pr, dept ps where   ps.dept like '%IT'  and pr.empno =100
    100, HR
    select  distinct ename ,pr.dept   from emp pr, dept ps where   ps.dept like '%IT'  and pr.empno =100
    TEST, HR
    select  distinct loc ,pr.dept   from emp pr, dept ps where   ps.dept like '%IT'  and pr.empno =100
    NYC, HR
    Using the below block I am getting column names only not the value of the column. I need to pass that value(TEST,NYC..) into l_col_val variable
    Please suggest
    ----- TABLE LIST
    CREATE TABLE EMP(
    EMPNO NUMBER,
    ENAME VARCHAR2(255),
    DEPT VARCHAR2(255),
    LOC    VARCHAR2(255)
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (100,'TEST','HR','NYC');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (200,'TEST1','IT','NYC');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (300,'TEST2','MR','NYC');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (400,'TEST3','HR','DTR');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (500,'TEST4','HR','DAL');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (600,'TEST5','IT','ATL');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (700,'TEST6','IT','BOS');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (800,'TEST7','HR','NYC');
    COMMIT;
    CREATE TABLE COLUMNAMES(
    COLUMNAME VARCHAR2(255)
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('EMPNO');
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('ENAME');
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('DEPT');
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('LOC');
    COMMIT;
    CREATE TABLE DEPT(
    DEPT VARCHAR2(255),
    DNAME VARCHAR2(255)
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('IT','INFORMATION TECH');
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('HR','HUMAN RESOURCE');
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('MR','MARKETING');
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('IT','INFORMATION TECH');
    COMMIT;
    PL/SQL BLOCK
    DECLARE
      TYPE EMPCurTyp  IS REF CURSOR;
      v_EMP_cursor    EMPCurTyp;
      l_col_val           EMP.ENAME%type;
      l_ENAME_val       EMP.ENAME%type;
    l_col_ddl varchar2(4000);
    l_col_name varchar2(60);
    l_tab_name varchar2(60);
    l_empno number ;
    b_l_col_name VARCHAR2(255);
    b_l_empno NUMBER;
    begin
    for rec00 in (
    select EMPNO aa from  EMP
    loop
    l_empno := rec00.aa;
    for rec in (select COLUMNAME as column_name  from  columnames
    loop
    l_col_name := rec.column_name;
    begin
      l_col_val :=null;
       l_col_ddl := 'select  distinct :b_l_col_name ,pr.dept ' ||'  from emp pr, dept ps where   ps.dept like ''%IT'' '||' and pr.empno =:b_l_empno';
       dbms_output.put_line('DDL ...'||l_col_ddl);
       OPEN v_EMP_cursor FOR l_col_ddl USING l_col_name, l_empno;
    LOOP
        l_col_val :=null;
        FETCH v_EMP_cursor INTO l_col_val,l_ename_val;
        EXIT WHEN v_EMP_cursor%NOTFOUND;
          dbms_output.put_line('l_col_name='||l_col_name ||'  empno ='||l_empno);
       END LOOP;
    CLOSE v_EMP_cursor;
    END;
    END LOOP;
    END LOOP;
    END;

    user1758353 wrote:
    Thanks Billy, Would you be able to suggest any other faster method to load the data into table. Thanks,
    As Mark responded - it all depends on the actual data to load, structure and source/origin. On my busiest database, I am loading on average 30,000 rows every second from data in external files.
    However, the data structures are just that - structured. Logical.
    Having a data structure with 100's of fields (columns in a SQL table), raise all kinds of questions about how sane that structure is, and what impact it will have on a physical data model implementation.
    There is a gross misunderstanding by many when it comes to performance and scalability. The prime factor that determines performance is not how well you code, what tools/language you use, the h/w your c ode runs on, or anything like that. The prime factor that determines perform is the design of the data model - as it determines the complexity/ease to use the data model, and the amount of I/O (the slowest of all db operations) needed to effectively use the data model.

  • Report with select list and link to call another report

    Hi,
    I am trying to do 2 reports (REPORT1 and REPORT2).
    The first is a summary report (REPORT1).
    This report will display sales figures for the year. Now, I need to have a select list in the result set that will have 2 options, depending on which option is chosen, I want to call REPORT2 with the select list as a parameter. How can I do this ?
    Let me try to explain what I did.
    I created REPORT1 on Page 100
    SELECT YEAR, sum(YTD_SALES), APEX_ITEM.SELECT_LIST(1,'DEPARTMENT','Department;DEPARTMENT,Division;DIVISION') Drilldown FROM SALES_ANALYSIS WHERE YEAR > 2000
    GROUP BY YEAR ORDER BY YEAR
    I created 2 hidden items namely P100_YEAR and P100_DRILLDOWN
    I also made the column YEAR as a link and specified both P100_YEAR and P100_DRILLDOWN as parameters to be passed.
    Next, I created REPORT2
    SELECT YEAR, DECODE(:P100_DRILLDOWN, 'Department', department, 'Division', Division) dept_div, sum(YTD_SALES) ytd_sales
    FROM SALES_ANALYSIS
    WHERE YEAR = :P100_YEAR
    When I run Report 1, it's fine, when I choose either Department or Division from the Select List and click on the link to call Report 2, report 2 is displayed, but the value being passed for P100_DRILLDOWN is not correct and as a result, I am unable to get correct results for Report 2
    Am I missing something ? Are there any alternate ways to do what I'm doing ?
    Thanks,
    Ashok

    Hi Ashok,
    The link definition will not know the value selected in the list as it is constructed only when the page is being rendered. You would need to create some javascript to handle this. I've done that here: [http://apex.oracle.com/pls/otn/f?p=267:182]
    The link on the EMPNO column has been defined in the HTML Expression setting for the column instead of the Link section. The HTML Expression that I have used is:
    &lt;a href="#" onclick="javascript:doDrilldown('#EMPNO#',this);"&gt;#EMPNO#&lt;/a&gt;And, in the page's HTML Header setting, I have added in:
    &lt;script type="text/javascript"&gt;
    function doDrilldown(empno,group)
    var g;
    var p = group.parentNode;
    while (p.tagName != "TR")
      p = p.parentNode;
    var x = p.getElementsByTagName("SELECT");
    if (x.length &gt; 0)
      g = x[0].value;
    var url = "f?p=&APP_ID.:183:&SESSION.::::P183_EMPNO,P183_GROUP:" + empno + "," + g;
    document.location.href = url;
    &lt;/script&gt;When a link is clicked, the doDrilldown function is called passing in the EMPNO value and the "this" object (which identifies the object triggering the call). The function starts from that object and goes up in the HTML tag tree to the nearest TR tag (the row tag that the link is on) and then finds the first SELECT list item on the row and gets its value. It then constructs a URL using this and the EMPNO value and performs a redirect to the second page (page 183 in this example).
    Andy

  • Need to have pop up window in selection screen and capture the user action.

    Hello Friends,
                         I have a requirement, that need to show a pop up window after execution, and to get the action from user using a Push button.
    I create a selection screen and a sub screen as window.
    After user execute from the selection screen, I am popping up this window.
    Window contains some input values to be entered and push button to identify the user action.
    I try to capture the user action using sy-ucomm, but it does not hold any value when user press the button.
    How to overcome this issue.
    Here is the definition of the window.
    Pop Up Window for getting values
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW TITLE title .
    PARAMETER : p_vdate LIKE t9aa01-validfrom,
                p_dcggt LIKE t9aa01-hkont,
                p_dcgst1 LIKE t9aa01-hkont,
                p_dcgst2 LIKE t9aa01-hkont,
                p_na LIKE t9aa01-hkont.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 20.
    SELECTION-SCREEN PUSHBUTTON 2(10) text-001 USER-COMMAND SVE.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF SCREEN 500.
    Cheers,
    Senthil
    Edited by: Senthil on Jan 7, 2008 11:03 AM

    Hi,
    Try using the below code.
           data : w_var type string.
           CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
              DEFAULTOPTION        = 'Y'
               textline1            = 'test '
             TEXTLINE2            = ' '
               titel                = 'check'
             START_COLUMN         = 25
             START_ROW            = 6
             CANCEL_DISPLAY       = 'X'
            IMPORTING
              ANSWER               = w_var.
                     if w_var = 'J'.
                     else.
                     endif.
    Comments : J indicates Yes and N indicates No
    Regards,
    Jeswanth

  • HT4972 I have a second generation iPad and can't clear the items in my update list. Is there a way to do this. I select them and it just says iS05 required

    I have a second generation iPad and can't clear the items in my update list. Is there a way to do this. I select them and it just says iS05 required

    There is no way to clear the update notifications - unless you delete the apps completely from the iPad and from iTunes on your computer.
    Obviously you want to continue to use the apps, so you either have to update the iPad and get the newer versions - or just ignore the update notifications. They will not go away.

  • How do I scroll down to see list of selected audiobooks and albums to sync with my iPhone in iTunes 11?

    I am running Windows 7 and using iTunes 11. I have an iPhone 4.
    In the past I have been able to sync selected albums and audiobooks with my iPhone using iTunes with no problems, but today when I tried to add an audiobook from my computer to my iPhone, I could not see it (or the audiobooks previously added to my iPhone) listed as a choice under Books --> Sync Audiiobooks --> Selected Audiobooks.
    I connected my iPhone to my laptop via USB. iTunes 11 comes up. My iPhone syncs automatically.
    I click the iPhone device in the sidebar and the list of choices (Summary, Info, Apps, Tones, Music, Movies, TV Shows, Books, and Photos) appears across the top of the main part of iTunes to the right of the sidebar.
    When I click on Music from this list of choices, I have selected Sync Music and Selected playlists, artists, albums, and genres.
    Under this I see my list of Playlists and the ones I have checked. I also see my list of Artists and the ones I have checked.
    Under these two items, I see the words Genres and Albums, but I cannot scroll down to see them (not even to see the ones I have previously selected to be synched with my iPhone).
    When I click on Books I see that Sync Audiobooks is checked and Selected audiobooks is selected, but I cannot see the list of audiobooks from which I can choose the ones I want to add to my iPhone and I cannot see the audiobooks that I previously selected and that are currently on my iPhone. I see the words Audiobooks and Parts, but I cannot scroll below these words to see the list of audiobooks that are on my laptop.
    Any help in resolving these issues would be greatly appreciated.
    Thanks.
    Eddie

    http://www.technipages.com/iphone-ipad-ipod-touch-enable-disable-shuffle-mode.ht ml
    I think you've tried that though.
    I had similar issue a few months ago - I think it didn't work unless I did it when the music was actually playing in the now playing section.

Maybe you are looking for

  • .gif animations not working and image thumbnail issues

    Hello, I hope that someone can help me out. I have animated .gif images on my iWeb site and they just recently stopped working, and I cant figure it out. These are my issues: Recently iWeb wont show my animated .gifs as they should. (I have found tha

  • I5Grid MII 14  MDO Filter Expression

    Hi Guys, I am building a sample webpage to display MDO query data using I5Grid. I am not sure if I am missing any lines. attached is my code and the webpage is empty with no errors on the browser console If I remove the below lines, the grid appears,

  • What is the maximum paper thickness a C6380 all in one printer can use?

    What is the maximum paper thickness a C6380 all in one printer can use? I want to print wedding invitations

  • MB03 Vendor Batch is not appear

    Hi, I just perform MIGO 101 of Purchase order. I enter vendor batch number ABC123. After save, I go to MB03, I cannot find my Vendor batch number that I have entered just now. Please suggest me where should I configure to display the vendor batch in

  • File conversion in words

    i cant converts my file into words documents