Select the value of the xml string property where certain conditions

Hi, I'm on 11.2.0.2 and just started with XPath. "got the string xml like this: [code]"

"[code] should output jdbc.schema password - User1, User2 user101 user201 tried: select x.schema_name, obpmdir.test x.password t, xmltable ("for $i in property/configuration/set return {$i/@name}' from xmltype (t.fuego_strvalue) schema_name varchar2 columns (1234) PATH 'value', password varchar2 (1234) PATH 'value') x; " has received the error: ORA-19276: XPST0005 - XPath step specifies an invalid element/attribute name: 19276 (value). 00000 - "XP0005 - XPath step specifies an invalid element/attribute name: (%s) ' * Cause: step the XPath specified is not a valid element or the attribute name that does not match all nodes according to the entry or the structure XML schema. * Action: Correct the name of element or attribute name may be misspelled. Regards Greg

See my first example here in response to your previous question: update the values of string xml.

BTW, to format your code, go to the so-called 'Advanced Editor ' and choose the formatting that you want in the menu behind the > icon.

Note that, as of now, none of the available options are really satisfactory to shape the code because he doesn't use fixed-width fonts.

Personally, I manually change the font "Courier New" and apply the effect 'Quote' for formatting my code snippets, that mimicks a little previous rendering allows us to get through the {code} tags (before the migration of the forum).

Tags: Database

Similar Questions

  • XML is not displayed as XML (hierarchical format) but as the xml string

    The condition is:

    To retrieve data of a table and are displayed in a table on a page in the ADF. One of the columns in the DB table is a "Type of XML", which stores the XML.  For each record in the table on page ADF, there is a hyper link, clicking on which the XML code must be displayed in a pop-up window.

    There is no problem to display data in the pop-up window.  But the popup does not display the data as a hierarchy XML (wrapping of lines at the end of each element).  It shows that the XML string...

    If someone could help?

    Concerning

    Christiane

    Add a property row to your inputtext to multi line. otherwise, you will never see the brakes of the line.

    Timo

  • Update the xml string values.

    Hello

    I'm on 11.2.0.2 and got table with column nclob that stores the long xml string.

    {code}

    "<? XML version = "1.0" encoding = "UTF - 8"? >

    <? Fuego version = "6.5.2" build "101272 =? >

    < Game >

    < configuration name = "TEST database" type = subtype "SQL" = "DDORACLE" >

    < name = "jdbc.pool.idle_timeout property" value = "5" / > "

    < name = "jdbc.pool.entry.max property" value = "10" / > "

    < name = "oracle.dateEqualsTimestamp property" value = "false" / > "

    < name = "jdbc.schema property" value = "user1" / > "

    < name = "jdbc.host property" value = "hostname" / > "

    < property name = "user" value = "user1" / >

    < name = "jdbc.port property" value = "1521" / > "

    < name = "jdbc.pool.min property" value = "0" / > "

    < name = "jdbc.pool.maxopencursors property" value = "50" / > "

    < name = "oracle.sid property" value = "dbsid" / > "

    < property name = "password" value = "user101" / >

    < name = "jdbc.xa property" value = "false" / > "

    < name = "jdbc.pool.max property" value = "10" / > "

    < / configuration >

    < configuration name = 'TEST base2' type = subtype "SQL" = "DDORACLE" >

    < name = "jdbc.pool.idle_timeout property" value = "5" / > "

    < name = "jdbc.pool.entry.max property" value = "10" / > "

    < name = "oracle.dateEqualsTimestamp property" value = "false" / > "

    < name = "jdbc.schema property" value = "user2" / > "

    < name = "jdbc.host property" value = "hostname" / > "

    < property name = "user" value = "user2" / >

    < name = "jdbc.port property" value = "1521" / > "

    < name = "jdbc.pool.min property" value = "0" / > "

    < name = "jdbc.pool.maxopencursors property" value = "50" / > "

    < name = "oracle.sid property" value = "dbsid2" / > "

    < property name = "password" value = "user201" / >

    < name = "jdbc.xa property" value = "false" / > "

    < name = "jdbc.pool.max property" value = "10" / > "

    < / configuration >

    < / set >

    "

    {code}

    My goal is to update the value of the password so that it is equal to the value of jdbc.schema value < property name = "jdbc.schema" value = "user2" / > in this case user2 | " '01'

    < property name = "password" value = "user201" / > <-that's my goal.

    Concerning

    Greg

    Hello

    You can find a few methods here: How To: nodes of XML update with values from the same document. Oracle of Odie's blog

    They are not applicable to your options and version though.

    This is the first applied to your case:

    declare

    v_xmldoc xmltype.

    Start

    Select xmlparse (document to_clob (t.xmldoc))

    in v_xmldoc

    of my_nclob_table t

    where t.id = 1;

    for r in)

    Select idx, schema_name

    of my_nclob_table t

    xmltable)

    "/ game/configuration.

    passage v_xmldoc

    columns idx for ordinalite

    , schema_name varchar2 (30) path 'property[@name="jdbc.schema"]/@value '.

    )

    )

    loop

    Select updatexml)

    v_xmldoc

    , "configuration/game / ['|]» [to_char (r.idx) |'] Property[@name="password"]/@value'

    r.schema_name | '01'

    )

    in v_xmldoc

    Double;

    end loop;

    Update my_nclob_table t

    Set t.xmldoc = to_nclob (xmlserialize (dash, document v_xmldoc))

    where t.id = 1;

    end;

    /

    Here's another, using DOM:

    declare

    CLOB doc;

    p dbms_xmlparser. Analyzer;

    domdoc dbms_xmldom. DOMDocument;

    docnode dbms_xmldom. DOMNode;

    conf_list dbms_xmldom. DOMNodeList;

    conf_node dbms_xmldom. DOMNode;

    password_node dbms_xmldom. DOMNode;

    schema_name varchar2 (30);

    password_value varchar2 (256);

    Start

    Select to_clob (xmldoc)

    in the doc

    of my_nclob_table

    where id = 1;

    p: = dbms_xmlparser.newParser;

    dbms_xmlparser.parseClob (p, doc);

    domdoc: = dbms_xmlparser.getDocument (p);

    dbms_xmlparser.freeParser (p);

    docnode: = dbms_xmldom.makeNode (domdoc);

    conf_list: = dbms_xslprocessor.selectNodes (docnode, ' / game/configuration ');

    for i from 0... dbms_xmldom.GetLength (conf_list) - 1 loop

    conf_node: = dbms_xmldom.item(conf_list, i);

    dbms_xslprocessor.valueOf (conf_node, 'property[@name="jdbc.schema"]/@value', schema_name);

    password_node: = dbms_xslprocessor.selectSingleNode (conf_node, 'property[@name="password"]/@value');

    dbms_xmldom.setNodeValue (password_node, schema_name |) '01');

    end loop;

    dbms_xmldom.writeToClob (domdoc, doc);

    dbms_xmldom.freeDocument (domdoc);

    Update my_nclob_table t

    Set t.xmldoc = to_nclob (doc)

    where t.id = 1;

    end;

    /

    Post edited by: odie_63 - added DOM example

  • Select the XML data

    Dear all,

    Please find a list of the steps done to read the date of conversion of currency by the last final query, that I can be able to obtain the release of the name of the Bank as the Central Bank, but impossible to extract the time, rates, currency of the XML data.

    Please tell us how to solve the problem.

    CREATE TABLE url_tab

    (

    URL_NAME VARCHAR2 (100),

    SYS URL. URIType

    );

    INSERT INTO url_tab VALUES

    ("This is a test URL',

    sys . UriFactory.getUri ("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" "")

    );

    INSERT into xml_data_tab select sys.xmltype.createXML (u.url.getClob ()) in u url_tab;

    Select Bank_name, xt1.* from

    XMLTable (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref', ))

                                   ' ( http://www.GESMES.org/XML/2002-08-01 ' as "gesmes"),

    ' / / gesmes:Envelope'

    FROM (select * from xml_data_tab)

    columns

    Path of varchar2 (100) Bank_name ' / gesmes:Envelope / gesmes:Sender / gesmes:name',

    outer join left perv_t XMLTYPE PATH "Cube/Cube")

    XMLTable (XMLNamespaces ('http://www.gesmes.org/xml/2002-08-01' as "gesmes"), )

    "/ / Cube/Cube."

    FROM (select * from xml_data_tab)

    COLUMNS

    path of varchar2 (100) of rate_date "@time"

    path varchar2 (100) coin "@currency."

    path of rate varchar2 (100) '@rate') xt1 on 1 = 1

    its work for me

    SQL > with xml_data_tab like)

    2. Select XMLType)

    3'http://www.gesmes.org/xml/2002-08-01' xmlns ="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" >. "

    4 reference rate

    5

    6 the European Central Bank

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    30

    31

    32

    33

    34

    35

    36

    37

    38

    39

    40

    41

    42

    43 ') as the double DATA

    44)

    45 select Bank_name, xt1. RATE_DATE, xt2.*

    XMLTable 46 (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref',

    47'http://www.gesmes.org/xml/2002-08-01"as"gesmes"),"

    48 ' / / gesmes:Envelope'

    49 FROM (select * from xml_data_tab)

    50 columns

    51 way of varchar2 (100) of Bank_name ' / gesmes:Envelope / gesmes:Sender / gesmes:name',

    52 perv_t XMLTYPE PATH 'Cube'):

    53 left outer join XMLTable (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref'),

    54                         '*'

    55 in PASSING (h.perv_t)

    56 COLUMNS

    path of varchar2 (100) 57 rate_date "Cube/@time."

    58 rate_data XMLType path ' / / Cube/Cube ') xt1 on 1 = 1

    59 left outer join XMLTable (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref'),

    60 ' / / cube/Cube/Cube. "

    61 FROM (select * from xml_data_tab)

    62 COLUMNS

    path of VARCHAR2 (3) currency 63 "@currency."

    number 64 path "@rate" rate) xt2 on 1 = 1;

    BANK_NAME RATE_DATE HEART RATE

    ---------------------------------------- ------------------------- --- ----------

    2015 Central Bank European-12-30 US $ 1.0926

    30-12-2015 of the European Central Bank JPY 131.66

    2015 Central Bank European-12-30 BGN 1.9558

    2015 Central Bank European-12-30 CZK 27.029

    30-12-2015 of the European Central Bank DKK 7.4625

    2015 Central Bank European-12-30 GBP.73799

    30-12-2015 of the European Central Bank HUF 313,15

    2015 Central Bank European-12-30 PLN 4.24

    30-12-2015 of the European Central Bank, RON 4.5296

    2015 Central Bank European-12-30 SEK 9.1878

    2015 Central Bank European-12-30 CHF 1.0814

    BANK_NAME RATE_DATE HEART RATE

    ---------------------------------------- ------------------------- --- ----------

    2015 Central Bank European-12-30 NOK 9.616

    30-12-2015 of the European Central Bank 7.637 HRK

    30-12-2015 of the European Central Bank RUB 79.754

    30-12-2015 of the European Central Bank TRY 3.1837

    2015 Central Bank European-12-30 AUD 1.499

    30-12-2015 of the European Central Bank BRL 4.259

    2015 Central Bank European-12-30 CAD 1.5171

    2015 Central Bank European-12-30 CNY 7.091

    2015 Central Bank European-12-30 HKD 8.4685

    30-12-2015 of the European Central Bank IDR 15081.33

    30-12-2015 of the European Central Bank, ILS 4.2606

    BANK_NAME RATE_DATE HEART RATE

    ---------------------------------------- ------------------------- --- ----------

    30-12-2015 of the European Central Bank INR 72.535

    30-12-2015 of the European Central Bank 1284.79 KRW

    2015 Central Bank European-12-30. 18.8867 MXN

    30-12-2015 of the European Central Bank MYR 4.6887

    2015 Central Bank European-12-30 NZD 1.5959

    30-12-2015 of the European Central Bank PHP 51.281

    30-12-2015 of the European Central Bank SGD 1.5449

    2015 Central Bank European-12-30 THB 39.334

    30-12-2015 of the European Central Bank ZAR 16.8847

    31 selected lines.

  • Need help to parse the xml string to populate the drop-down list

    Here is my: problem

    I have a hidden text field that contains the text of an xml

    <>facilities
    < building >
    < name > Building A < / name >
    < name > building B < / name >
    < name > building C < / name >
    < name > building D < / name >
    < name > building E < / name >
    < name > building F < / name >
    < name > building G < / name >
    < name > building H < / name >
    < / build >
    < / facilities >

    My goal is to read this with JavaScript xml string to populate a drop-down list with values of element (name). Does anyone know how script that?

    Attached is a sample .xdp

    See you soon,.

    Jesse

    Here is an example of change. I put the code click on the button, so you can see it in operation... You can place this code in the event that makes sense for you. I also added another field to show the DOM (this is for debugging purposes and you can remove this field if you want).

    Paul

  • getting a value from an XML string

    If I want a loader to load a text file based on XML how I'd get the XML to return a string.


    The first lines of code are my xml file.
    The following code excerpt is my charger of xml.
    The last code snippet is where I want my text file to load.
    In my line of code which is: myLoadVar.load (t.content); How can I get the value of t.content I got an xml file for a file name? I think I should do my xml file returns a string.

    You must add a line of code. I need to see the where it is located, in the lines below.

  • Color of the text label changing under certain conditions

    Hello

    I have these labels and I would like to change the color of the text IF the text has some specific value (from an XML created by a program); for example, the default text color is red, but if the text value is 'Yes', the text color should be green.

    Any help much appreciatted, as usual...

    Thank you.

    not sure, but you might be able to get away with something like this:


    http://www.Adobe.com/2006/mxml"layout ="absolute">
       
       
           

    public void changeColor(value:String):uint
    {
    If (value is 'Yes')
    {
    Return 0x007F00;
    }
    on the other
    {
    Return 0x7F0000;
    }
           
    }
               
    ]]>
       
       
       
           
           
           
       

       

    using a single label in a point renderer, passing through the "data.text" value

  • Insert data into the same table based on certain conditions

    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.

    How to achieve that?

    Thank you.

    978184 wrote:
    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & CurrentInstallment

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).

    You can do this way:

    This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.

    insert into your_table
    (col1, col2, col3...current_installment, month_field)
    select col1, col2, col3..,
           current_installment +
           case when paidamount > 0 and current_installment < total_installment then
            row_number() over (
                                partition by column1, column2,.. columnn      -->You may choose partition if you want the
                                                                              --Increment of Current_installment to reset after particular combination ends
                                order by primary_key        -->Order the Increment, you may choose to add more columns to order by
                              )
          else
            0                                               --> if condition is not met, then Add 0
          end curr_installment,
          add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month
      from your_table;
    
  • hide the text label in the section report IR under certain conditions

    Hello
    We have a textlabel and a calculated field in a section of report to the IR 11.1.2.1. Is it possible (in a script) to hide the textlabel and field based on certain conditions, like for example, if the field computes to 'zero '?
    Thank you.

    Use a field instead of the text label. In the Expression Editor you can use the function if() {} else {}

    HTH

    Wayne

  • Select the XML ELEMENT of Java not supported

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production0
    PL/SQL Release 12.1.0.2.0 - Production0
    CORE12.1.0.2.0Production0
    AMT for Linux: Version 12.1.0.2.0 - Production0
    NLSRTL Version 12.1.0.2.0 - Production0

    Using JavaSE - 1.7

    I have the following:

    stmt = getStatement();

    try {}

    String T1 = "SELECT XMLELEMENT (\"CHECKINOUT\ "").

    + ", xmlattributes (property-id AS \"PROPERTY\ ' ").

    +", msgid AS \"ID\ «»

    +"status AS \"STATUS\ «»

    +', lead_name AS \"OCCUPANT\ «»

    +"email LIKE \"EMAIL\ «»

    +', unit_ext AS \"EXTENSION\ «»

    +', folio_id AS \"FOLIO\ «»

    + "," $: ~' AS \"RECORDS\")) ' "

    + 'LIKE tosend.

    + "OF TABLE (pm_pbx_systems.checkinout ("LOL"));

    RS = stmt.executeQuery (q1);

    {while (RS. Next())}

    System.out.println (RS. GetString ("tosend"));

    valid = true;

    }

    The result set all out them with a null value. How do I would be that it works?

    The query returns an XMLType object, not a string. That's why your rs.getString returns null.

    Use the SQLXML interface to read the value of the column in the result set:

    rs.getSQLXML("TOSEND").getString)

    You can also serialize a string directly in the query:

    SELECT XMLSerialize (content

    XMLELEMENT ("CHECKINOUT',

    ...

    )

    VARCHAR2 (4000) - or CLOB, according to your requirement

    )

    TABLE...

    and you will be able to use rs.getString ().

    I suggest also not coding of SQL queries directly in the Java code.

    Encapsulate as much as you can in the PL/SQL functions or procedures and simply call those.

    Maintenance will be easier and safer.

  • The XML string to time (?) to do the calculations

    Hello

    I have a XML file which I receive channels such as + 115:50, 55:25 + which represents the time in a format mmm: ss. It's supposed to be for a football game.

    I need to find a way to make calculations and then put it back in the database. Tell me, if I added 90/10 and 112:55 I would get 203:05.

    What would be the best way to go about this?
    I have to create a custom for this class? Or is it possible to use Date to accomplish what I need?


    Thank you

    Karl

    I don't know if it is possible to achieve with Date, but in any case, it is easy to solve like this:

    Dim a = '11:50;
    String b = "05:45;

    int min = Integer.valueOf (a.substring (0, a.lastIndexOf (":"))) + Integer.valueOf (b.substring (0, b.lastIndexOf (":")));) ")))
    dry int = Integer.valueOf (a.substring (a.lastIndexOf(":") + 1, a.length (())) + Integer.valueOf (b.substring (b.lastIndexOf(":") + 1, b.length (()));
    mins = minutes + dry/60;
    seconds = seconds % 60;
    System.out.println(mins+":"+secs);

    Edited by: Diegolas A, December 16, 2011 04:00

  • Get the next row in the set of results under certain conditions

    Hello
    I have a result set with a column in ascending order of the numbers. Now, I want to compare these numbers to a value. If one of the numbers exactly matches the value then all is well and I use number < = value as a condition. If the value does not match exactly I want to get the next number in the result as well. A short example

    NB in resultset
    41
    82
    123
    164
    205
    246

    To compare with value = 200, I want to have

    41
    82
    123
    164
    205

    as a result.

    To compare with value = 164, I want to have

    41
    82
    123
    164

    Thanks for any advice.
    Carsten cordially

    You can use analytical functions for that. There are several options, here is one.

    with testdata as (select 41 num from dual union all
                      select 82  num from dual union all
                      select 123 num from dual union all
                      select 164 num from dual union all
                      select 205 num from dual union all
                      select 246 num from dual)
    /* end of test data creation */
        ,resulttab as (select num, nvl(lag(num) over (order by num) ,0) next_num
                       from testdata )
    select num
    from resulttab
    where next_num < 200 ;
    NUM
    ---
    41
    82
    123
    164
    205
    
    ...
    select num
    from resulttab
    where next_num < 164 ;
    41
    82
    123
    164
    
  • Select the value of the field in the database column stores xml as a varchar

    Hi all

    Oracle version is 11 GR 2.

    I have a column of a database in which we store the XML string varchar2.

    "I need to extract only newvalue when field nameof the property ="modifiedBy'. '.

    In this case my answer would be - maker16

    My XML is as below.

    with t as
    (
    select '<?xml version="1.0" encoding="UTF-8"?>
    <changeinfo><property name="checkedOn" newvalue="03/21/2013 15:51:11" oldvalue="03/21/2013"/><property name="modifiedOn" newvalue="07/22/2013 14:04:55" oldvalue="03/21/2013"/><property name="phoneNo" newvalue="9942251"/><property name="modifiedBy" newvalue="maker16" oldvalue="clarissamaker"/></changeinfo>' as datacolumn
    FROM dual
    )
    select extractvalue(datacolumn,'/changeinfo/property name[@property name="modifiedBy"]/newvalue') from t;
    
    

    How to write a select statement to get the above result?

    Thank you

    SID

    You can do it like

    1. get the name and NewValue as columns and then create a filter with the WHERE clause.

    2. or you can filter when you set the path itself.

    --I have not applied the WHERE clause to filter the NAME. You can do that.
    
    SQL> with t as
      2  (
      3  select '
      4  
      5  
      6  
      7  
      8  
      9  ' as datacolumn
     10  FROM dual
     11  )
     12  select t1.name, t1.newval
     13    from t
     14       , xmltable
     15         (
     16            '/changeinfo/property' passing xmltype(datacolumn)
     17            columns
     18              name varchar2(100) path '@name',
     19              newval varchar2(100) path '@newvalue'
     20         ) t1;
    
    NAME                           NEWVAL
    ------------------------------ ------------------------------
    checkedOn                      03/21/2013 15:51:11
    modifiedOn                     07/22/2013 14:04:55
    phoneNo                        9942251
    modifiedBy                     maker16
    
    --This filters the Name attribute in the path definition itself.
    
    SQL> with t as
      2  (
      3  select '
      4  
      5  
      6  
      7  
      8  
      9  ' as datacolumn
     10  FROM dual
     11  )
     12  select t1.newval
     13    from t
     14       , xmltable
     15         (
     16            '/changeinfo/property[@name="modifiedBy"]' passing xmltype(datacolumn)
     17            columns
     18              newval varchar2(100) path '@newvalue'
     19         ) t1;
    
    NEWVAL
    ------------------------------
    maker16
    

    And the $ 1 million question would be why VARCHAR2 type of XML data.

  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • Select the text to all_views returns an empty string

    My application allows the user to choose between the data provider for ODBC and the data provider for Oracle. (ODP)

    When you use the ODBC statement:

    Select the text in all_views where view_name = 'MYVIEW '.

    Returns the string expected.

    If I connect via ODP however it returns an empty string.
    (If I use "Select *" it tells me that the text_length is 154 in this case-, so there are certainly available text.)

    I think it has something to do with the fact that the data type is long.
    In both cases I recover data with rdr. GetChars(), that should work.

    If I use the dbms_metadata.get_ddl instead of this function, it returns the string (probably because the return type is LONG)
    Unfortunately this function works only for views in the current schema, while the original works of Select for any view.
    (And I don't know what version of Oracle, this feature has been added-I need to support older versions too).

    Similarly, if I use one of the XML functions to retrieve the text in XML format it works fine.
    (Again it is probably returned as a VARCHAR2 instead of a LONG.)

    The strange thing is that when I created my own table containing a column LONG, I've been able to load and retrieve data without any problem.

    The problem seems to be specific to this column in all_views.

    Anyone know a solution to this?

    Thank you
    Mike

    Did you put InitialLONGFetchSize property appropriately on your OracleCommand object? See if this property does the trick for you?

Maybe you are looking for