Ask the CLOB column (with XML content)

1. how to extract a particular xml tag value for a column with the CLOB data type.

Example:

< REQUEST_DETAIL >

PR < GROUP_TYPE > < / GROUP_TYPE >

< GroupName > ASSET MANAGEMENT TECHNICAL DATA < / GroupName >

< BUS_UNIT_ACRN > SCS-FCAT < / BUS_UNIT_ACRN >

< PROJ_MGR_ID > < / PROJ_MGR_ID >

< PROJ_MGR_NAME > Roland Roy < / PROJ_MGR_NAME >

< / REQUEST_DETAIL >

Select

XmlType (provable). Extract('/REQUEST_DETAIL/GROUP_TYPE/text()').getStringVal)

e t

/

example above works.

If I do not know the order of xml tag to ask how can I get the value.

(/ * * / / * * / REQUEST_DETAIL/GROUP_TYPE / * / *)

2 using the DBMS_LOB. SUBSTR takes longer to run and it never returns results and session will wait status for access to LOB_INDEX content (at the same time the CLOB column is used by the application).

Y at - it another option for faster results.

SELECT DBMS_LOB. SUBSTR (xml_blob, 4, DBMS_LOB.) INSTR (xml_blob, "< name >", 1, 1) + 6) name.

status,

CNT to COUNT (*)

OF LOG_TBL

WHEN TRUNC (IO_DATE) = TRUNC (SYSDATE)

GROUP OF DBMS_LOB. SUBSTR (xml_blob, 4, DBMS_LOB.) INSTR (xml_blob, "< name >", 1, 1) + 6),

status

Kind regards

Veera

Adiitional your reuirement to omit the public areas

2729533 wrote:

Your 1 returln sql any domain name (p099 and public - seems to search all nodes in an xml file). I only need 1 domain name (and omit the public areas)

  1. SELECT X.*
  2. T
  3. , xmltable ('(//*[DomainName!="PUBLIC"]/DomainName) [1] ')
  4. PASSAGE xmlparse (document t.XML_BLOB)
  5. THE DOMAIN VARCHAR2 COLUMNS (15) PATH '.'
  6. ) X
  7. where t.no = 317663815

Tags: Database

Similar Questions

  • Ask the CLOB and out of model xml - EBS R12.1.3

    Hi all

    Due to a limitation in the module IBY, we are unable to produce a file for the receivables credit institutions.

    The data that we want are stored in the table IBY_XML_ONLINE_FCI_1_0_V via a CLOB. There is a TRXNMID column that we would then have to query to get the good deal.

    Our thoughts are now report(XDODTEXE style) we create an xml model, so they can run a simultaneous program and generate a file according to the model of etext.

    We have the required format of installation already as a model of etext.

    Is there a way to create the definition of data, so it can pickup the column / the CLOB field and have the extext generates output?

    Or does anyone know a better way to do this?

    See you soon,.

    Russell H.

    Focus on the following document on how to treat the CLOB data:

    • Doc-ID 1560000.1 R12: Tags XML type column CLOB xmldata become & lt and & gt in the exit of BI Publisher model
  • Query to read the XML of the CLOB column

    Hello

    I want a SQL to get the following information extracted a CLOB column.

    MasterReport/sg:RptDef/sg:RptCell@RealDesc MasterReport/sg:RptDef/sg:RptCell@RealNum
    100 credits
    flow rates from 100

    Example of XML data in the column of table is:
    <? XML version = "1.0" encoding = "UTF-8"? >
    < MasterReport xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:sg = "http://www.oracle.com/fsg/2002-03-20/" xsi: schemaLocation = "http://www.oracle.com/2002-03-20/fsg.xsd" >
    Vision Portugal < sg:LDGName > < / sg:LDGName >
    Vision Portugal < sg:SOBName > < / sg:SOBName >
    Vision Portugal < sg:DataAccessSetName > < / sg:DataAccessSetName >
    Model report 30 < sg:InternalReportName > < / sg:InternalReportName >
    < sg:CustomParam10 / >
    < sg:RowContext RowId = "r100001" >
    < sg:RowName / >
    disputes credits - Total amount previous period < sg:RowLineItem > < / sg:RowLineItem >
    < sg:RowDispUnit > 1 < / sg:RowDispUnit >
    < sg:RowDispFormat / >
    < sg:RowUnitOfMeasure > EUR < / sg:RowUnitOfMeasure >
    < sg:RowLedgerCurrency > ALL < / sg:RowLedgerCurrency >
    < sg:RowCurrencyType > T < / sg:RowCurrencyType >
    < sg:RowChangeSign > 0 < / sg:RowChangeSign >
    < sg:RowSeq > 1.0000000000000 < / sg:RowSeq >
    < / sg:RowContext >
    < sg:RowContext RowId = "r100002" >
    < sg:RowName / >
    < sg:RowLineItem > Litigation credits-taxed amounts of Column2 for the previous period < / sg:RowLineItem >
    < sg:RowDispUnit > 1 < / sg:RowDispUnit >
    < sg:RowDispFormat / >
    < sg:RowUnitOfMeasure > EUR < / sg:RowUnitOfMeasure >
    < sg:RowLedgerCurrency > ALL < / sg:RowLedgerCurrency >
    < sg:RowCurrencyType > T < / sg:RowCurrencyType >
    < sg:RowChangeSign > 0 < / sg:RowChangeSign >
    < sg:RowSeq > 2.0000000000000 < / sg:RowSeq >
    < / sg:RowContext >
    < sg:ColContext ColId = "c1000" >
    < sg:ColAmountType / >
    < sg:ColPeriod / >
    < sg:ColPerOffset / >
    < sg:ColChangeSign / >
    < sg:ColPosition / >
    < sg:ColSeq / >
    < sg:ColWidth > 100 < / sg:ColWidth >
    < / sg:ColContext >
    < sg:ColContext ColId = "c1001" >
    Total of < sg:ColName > < / sg:ColName >
    < sg:ColDescr / >
    < sg:ColDispUnit > 1 < / sg:ColDispUnit >
    < sg:ColUnitOfMeasure > EUR < / sg:ColUnitOfMeasure >
    < sg:ColLedgerCurrency > ALL < / sg:ColLedgerCurrency >
    < sg:ColCurrencyType > T < / sg:ColCurrencyType >
    < sg:ColDispFormat > 999999999.99 < / sg:ColDispFormat >
    CDA-real < sg:ColAmountType > < / sg:ColAmountType >
    < sg:ColPerOffset > 0 < / sg:ColPerOffset >
    < sg:ColAmntId > 14 < / sg:ColAmntId >
    < sg:ColParamId >-1 < / sg:ColParamId >
    A < sg:ColType > < / sg:ColType >
    < sg:ColStyle > B < / sg:ColStyle >
    < sg:ColPeriod > 10 / 08 < / sg:ColPeriod >
    < sg:ColPeriodYear > 2008 < / sg:ColPeriodYear >
    < sg:ColPeriodNum > 11 < / sg:ColPeriodNum >
    < sg:ColPeriodStart > 2008 - 10-01 T 00: 00:00 < / sg:ColPeriodStart >
    < sg:ColPeriodEnd > 2008-10-31 T 00: 00:00 < / sg:ColPeriodEnd >
    < sg:ColChangeSign > 0 < / sg:ColChangeSign >
    the totals of < sg:ColHeadLine1 > < / sg:ColHeadLine1 >
    < sg:ColHeadLine2 / >
    < sg:ColHeadLine3 / >
    < sg:ColHeadLine4 / >
    < sg:ColHeadLine5 / >
    < sg:ColHeadLine6 / >
    < sg:ColHeadLine7 / >
    < sg:ColHeadLine8 / >
    < sg:ColHeadLine9 / >
    < sg:ColPosition > 99 < / sg:ColPosition >
    < sg:ColSeq > 1.0000000000000 < / sg:ColSeq >
    < sg:ColWidth > 14 < / sg:ColWidth >
    < / sg:ColContext >
    "< sg:RptDef RptId = 'p1001" RptDetName = "book = PT Vision (Vision Portugal)" RptPESegm = "" RptPEVal = "" RptTabLabel = "Exit 1 (Vision PT)" > "
    < sg:RptLine RptCnt = 'p1001"RowCnt ="r100001"LineRowSeq ="1.0000000000000"LinCnt ="l100001">
    < sg:RptCell ColCnt RealDesc "c1000" = "flows" = > flow < / sg:RptCell >
    < sg:RptCell ColCnt "c1001' RealNum = '100.000000' = > 100,00 < / sg:RptCell >
    < / sg:RptLine >
    < sg:RptLine RptCnt = 'p1001"RowCnt ="r100002"LineRowSeq ="2.0000000000000"LinCnt ="l100002">
    < sg:RptCell ColCnt = "c1000" RealDesc = "creditsd" > credits < / sg:RptCell >
    < sg:RptCell ColCnt "c1001' RealNum = '100.000000' = > 100,00 < / sg:RptCell >
    < / sg:RptLine >
    < / sg:RptDef >
    < sg:TabCount > 1 < / sg:TabCount >
    < / MasterReport >

    Please help me.

    Concerning
    Goussard

    Published by: user576087 on March 18, 2012 23:54

    I don't know if you want that the values of the attribute or the element, but it should give you a good start:

    SQL> alter session set nls_numeric_characters = ".,";
    
    Session altered
    
    SQL>
    SQL> select x.*
      2  from my_table t
      3     , xmltable(
      4         xmlnamespaces('http://www.oracle.com/fsg/2002-03-20/' as "sg")
      5       , '/MasterReport/sg:RptDef/sg:RptLine'
      6         passing xmltype(t.xmldoc)
      7         columns type    varchar2(30) path 'sg:RptCell[1]'
      8               , amount  number       path 'sg:RptCell[2]'
      9       ) x
     10  ;
    
    TYPE                               AMOUNT
    ------------------------------ ----------
    debits                                100
    credits                               100
     
    
  • The number of characters in the CLOB column is supported by the report of the APEX

    Hello

    Actually, I have a report of the Apex based on CLOB column, which includes data whose length exceeds 10,000 characters.

    up to 10,000 characters, it works fine, but once it get records with characters more than 10 + lift

    ORA-06502: PL/SQL: digital or value error: character string buffer too small

    Thank you and best regards,

    Ashish

    2902196 wrote:

    Please update your forum profile with a recognizable username instead of "2902196": Video tutorial how to change username available

    Always include the information referred to in these guidelines when you post a question: How to get the answers from the forum

    Actually, I have a report of the Apex based on CLOB column, which includes data whose length exceeds 10,000 characters.

    up to 10,000 characters, it works fine, but once it get records with characters more than 10 + lift

    ORA-06502: PL/SQL: digital or value error: character string buffer too small

    The maximum size of a column report CLOB value is 32 KB. However, the maximum size for the content of the line of the full report is also 32 KB (including the HTML markup), so you can be hitting this limit because of the size of your 10 K CLOB data + the rest of the line.

    According to the database character set and the characters which that contains data, the character encoding may use more than one byte to represent a character.

  • Send the POST request with BLOB content

    Hello

    I usually use the following structure to send the POST request with content of varchar2 and numbers

          content := '{"Original File Name":"'||V_HOMEBANNER_1_EN_NAME(indx)||'"}';
         url := 'https://api.appery.io/rest/1/db/Names'; 
          req     := utl_http.begin_request(url, 'POST',' HTTP/1.1');
          UTL_HTTP.set_header(req, 'X-Appery-Database-Id', '5f2dac54b02cc6402dbe');
          utl_http.set_header(req, 'content-type', 'application/json');
          UTL_HTTP.set_header(req, 'X-Appery-Session-Token', sessionToken);
          utl_http.set_header(req, 'Content-Length', LENGTH(content));
          utl_http.write_text(req, content);
          res := utl_http.get_response(req);
    
    
    BEGIN
      LOOP
        utl_http.read_line(res, buffer);
      END LOOP;
      utl_http.end_response(res);
    EXCEPTION
    WHEN utl_http.end_of_body THEN
      utl_http.end_response(res);
    END;
    

    And it works very well. However, now I want to send/download (jpg image) files a blob in a MongoDB collection called "Files" (so url: = ttps://api.appery.io/rest/1/db/files). The guide of the collection is the next loop as a general advice:

    curl -X POST \
      -H "X-Appery-Database-Id: 5f2dac54b02cc6402dbe" \
      -H "X-Appery-Session-Token: <session_token>" \
      -H "Content-Type: <content_type>" \
      --data-binary '<file_content>' \
      https://api.appery.io/rest/1/db/files/<file_name>
    

    But I couldn't translate this curvature in PL/SQL query. Specifically, the part (-given binary '< file_content >")

    I have these BLOB files in an Oracle table, and they are stored with their names as follows:

    File_name File_content
    PIC_1.jpgBLOB OBJECT
    PIC_2.jpgBLOB OBJECT
    PIC_3.jpgBLOB OBJECT

    My question, how to download these images in the target URL?

    After a few hours I spent on it, I got it working. My solutions is inspired by this http://blog.optiosys.com/?p=246

    Since you must send you no the (same) CLOB and BLOB files, you need just need to replace .write_text by .write_raw.

    Here is my part of work for your reference:

    content: = V_HOMEBANNER_1_EN (indx);    -blob

    file_name: = 'test.jpg ';

    URL: = "https://api.appery.io/rest/1/db/files/": file_name;

    Req: = utl_http.begin_request (url, 'POST', ' HTTP/1.1');

    Utl_http.set_header (req, 'X-Appery-database - Id', '53fae4b02cc4021dbe');

    Utl_http.set_header (req, 'X-Appery-Session-token', sessionToken);

    Utl_http.set_header (req, "content-type', ' image/jpeg");

    req_length: = DBMS_LOB.getlength (CONTENT);

    DBMS_OUTPUT. Put_line (req_length);

    -IF YOU LIMIT THE DATA UNDER 32KB MSG:

    IF req_length<=>

    THEN

    Start

    Utl_http.set_header (req, "Content-Length", req_length);

    Utl_http.write_raw (req, content);

    exception

    while others then

    DBMS_OUTPUT. Put_line (SQLERRM);

    end;

    -IF MSG DATA MORE THAN 32 KB

    ELSIF req_length > 32767

    THEN

    BEGIN

    DBMS_OUTPUT. Put_line (req_length);

    Utl_http.set_header (req, "Transfer-Encoding", "Chunked");

    While (offset<>

    LOOP

    DBMS_LOB. Read (content, amount, offset, buffer);

    Utl_http.write_raw (req, buffer);

    offset: = offset + amount;

    END LOOP;

    exception

    while others then

    DBMS_OUTPUT. Put_line (SQLERRM);

    end;

    END IF;

    l_http_response: = UTL_HTTP.get_response (req);

    Utl_http.READ_TEXT (l_http_response, response_body, 32767);

    Utl_http.end_response (l_http_response);

    I hope this helps. Good luck

  • Text is wrapped in the clob column

    I have a table with a clob column. I'm loading using PLSQL block:

    declare
    v_sql varchar2 (32000);
    Start
    v_sql: = q'{text
    ....
    ....}';
    insert into values tb1 (v_sql);
    commit;
    end;
    /

    However, if a line is long in my thong and then wraps the line and a single sentence is transformed into two. Please suggest how I can fix it. I use 11g.

    PS why are you eager to store SQL statements in a table? Looks like poor design to me.

  • How can I initialize the counter_ column with 1 every 5 rows

    How can I initialize with 1 again once the 'counter_' column every 5 rows on the following query?

    SELECT L.LETTER

    COUNTER_ ROWNUM

    FROM (SELECT "A" LETTER FROM DUAL UNION ALL

    SELECT THE LETTER 'B' FROM DUAL UNION ALL

    SELECT THE LETTER 'C' FROM DUAL UNION ALL

    SELECT WOULD BE ' LETTER FROM DUAL UNION ALL

    SELECT THE LETTER 'E' FROM DUAL UNION ALL

    SELECT THE LETTER 'F' FROM DUAL UNION ALL

    SELECT THE LETTER 'G' FROM DUAL UNION ALL

    SELECT THE LETTER 'H' FROM DUAL UNION ALL

    SELECT "I" LETTER FROM DUAL UNION ALL

    SELECT THE LETTER 'J' IN UNION DOUBLE ALL THE

    SELECT THE LETTER 'K' FROM DUAL UNION ALL

    SELECT THE LETTER 'L' FROM DUAL UNION ALL

    SELECT'M ' LETTER FROM DUAL UNION ALL

    CHOOSE "N" LETTER OF THE DUAL UNION ALL

    SELECT 'O' THE DOUBLE LETTER) L

    I need reach the result below:

    LETTERROWNUM
    1A1
    2B2
    3C3
    4D4
    5E5
    6F1
    7G2
    8H3
    9I have4
    10J5
    11K1
    12L2
    13M3
    14N4
    15O5

    You can just use the MOD to do.

    with w_data like)

    SELECT L.LETTER

    COUNTER_ ROWNUM

    FROM (SELECT "A" LETTER FROM DUAL UNION ALL

    SELECT THE LETTER 'B' FROM DUAL UNION ALL

    SELECT THE LETTER 'C' FROM DUAL UNION ALL

    SELECT WOULD BE ' LETTER FROM DUAL UNION ALL

    SELECT THE LETTER 'E' FROM DUAL UNION ALL

    SELECT THE LETTER 'F' FROM DUAL UNION ALL

    SELECT THE LETTER 'G' FROM DUAL UNION ALL

    SELECT THE LETTER 'H' FROM DUAL UNION ALL

    SELECT "I" LETTER FROM DUAL UNION ALL

    SELECT THE LETTER 'J' IN UNION DOUBLE ALL THE

    SELECT THE LETTER 'K' FROM DUAL UNION ALL

    SELECT THE LETTER 'L' FROM DUAL UNION ALL

    SELECT'M ' LETTER FROM DUAL UNION ALL

    CHOOSE "N" LETTER OF THE DUAL UNION ALL

    SELECT 'O' THE DOUBLE LETTER) L

    )

    Select the letter, COUNTER_,

    MOD (counter_-1, 5) + 1 ngrp

    of w_data

    /

    L COUNTER_ NGRP

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

    A          1          1

    B          2          2

    C          3          3

    D          4          4

    E          5          5

    F          6          1

    G          7          2

    H          8          3

    I          9          4

    J         10          5

    K         11          1

    L         12          2

    M         13          3

    N         14          4

    O         15          5

    15 selected lines.

  • How to remove or customize the white preloader with edge content in DPS applications.

    I'm looking for a possible solution with the White Page of Preloader when you create an API via Indesign.

    The content is created entirely in Adobe Edge animate, then its published HTML code is placed by the superposition of Folio of Indesign. Then via the DPS APP BUILDER converted into an IPA, this work is fantastic!

    .. but...

    When the application is launched on the iPad there are always, always the white screen of preload with the wheel of rotation for a few cases.

    Tried to customize the preloader in Edge screen but the white screen will display first, then the custum pre-load the screen, then the content.

    Also tried to directly edit the HTML code, but no luck, still has the white screen with the spinning wheel.

    Someone have an idea how to hide this white screen? Or how to customize it?

    Thanks for any suggestions.

    Instead of creating the image of the poster on the edge, try to use a poster in InDesign. The image of the poster on the top of the overlay from the edge and put the overlay with a delay, for example 0.5 seconds. The image of the poster must appear initially, while the superimposition of edge loading in the background, and then appears in front of the image of the poster.

  • SQLLDR: How to fill the empty columns with specific data by default?

    Hello

    We are 11G

    Here is a complete example:

    (1) the definition of the table:
    create table IMPORT_PRJ_TIMESHEETS
    (
      RESSOURCE_CODE VARCHAR2(20),
      REFERENCE_DATE VARCHAR2(20),
      STATUS         VARCHAR2(20),
      PROJET_CODE    VARCHAR2(50),
      TACHE_ID       VARCHAR2(100),
      TACHE_DESC     VARCHAR2(250),
      RAF            NUMBER,
      JOUR1          NUMBER,
      JOUR2          NUMBER,
      JOUR3          NUMBER,
      JOUR4          NUMBER,
      JOUR5          NUMBER,
      JOUR6          NUMBER,
      JOUR7          NUMBER,
      IMPORT_DATE    DATE
    );
    (2) the CTL:
    LOAD DATA
    CHARACTERSET WE8ISO8859P1
       APPEND INTO TABLE IMPORT_PRJ_TIMESHEETS
    -- Pour eliminer la ligne d'en-tete
    WHEN PROJET_CODE != 'ID projet'
       FIELDS TERMINATED BY '*-*' OPTIONALLY ENCLOSED BY '"'
    ( RESSOURCE_CODE       CONSTANT '!RESSOURCE_CODE!'
    , REFERENCE_DATE       CONSTANT '!REFERENCE_DATE!'
    , STATUS               CONSTANT '!STATUS!'
    , PROJET_CODE          CHAR
    , TACHE_ID             CHAR
    , TACHE_DESC           CHAR
    , RAF                  CHAR "TO_NUMBER( :RAF, '999G999D99')"
    , JOUR1                CHAR
    , JOUR2                CHAR
    , JOUR3                CHAR
    , JOUR4                CHAR
    , JOUR5                CHAR
    , JOUR6                CHAR
    , JOUR7                CHAR
    , IMPORT_DATE          SYSDATE
    )
    {code}
    
    
    3) the datafile :
    {code}
    ID projet*-*ID tâche*-*Tâche/Description*-*RàF*-*lun. 13/07*-*mar. 14/07*-*mer. 15/07*-*jeu. 16/07*-*ven. 17/07*-*sam. 18/07*-*dim. 19/07*-*
    FR-FR-NT2300135*-* *-*GAMMAWEB - Coordination*-*0,00*-* *-* *-* *-*8,00*-*8,00*-* *-* *-*
     *-* *-*Holiday*-* *-* *-*8,00*-* *-* *-* *-* *-* *-*
     *-* *-*Special leave*-* *-*8,00*-* *-* *-* *-* *-* *-* *-*
     *-* *-*Vacation*-* *-* *-* *-*8,00*-* *-* *-* *-* *-*
    
    {code}
    
    - As you can see, the datafile delimiter is "*-*" .... there's no pb about this.
    
    - Also, there are 5 lines in the datafile. Currently, the _*load status*_ is :
       - Line 1 is the header  >>> not loaded, and that's fine with me.
       - Line 2 is successfully loaded
       - Line 3 / Line 4 / Line 5 : are not loaded .. but I need these lines ...
    
    *What I'd like to get is to successfully load lines 3 to 5 with a default values for the first 3 columns (project/task ID/ task desc)*
    
    I hope it's clear enough and that you will be able to provide a good answer ..
    
    Thanks in advance,
      Olivier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    In your example, the only ranked with value on all lines is TACHE_DESC.
    If this field is always filled, try this:
    WHEN TACHE_DESC! = "Task/Description".

    Concerning

  • Can not see the left column with "Inbox, JUNK e-mail, deleted, sent.

    All of a sudden I can't see the left column of Windows Mail-"Inbox, drafts, SPAM, messages deleted" etc.  Top of the page of office can be reduced manually

    View | Page layout | List of folders. Check it out.

    PS WinMail is a Spam folder.

  • problem of counting of returns to the clob line with external tables

    Hello

    I want to count the number of lines (x0A) in a clob loaded from an external table.
    This is the data of the file
    d               2010-06-21 13:25:23               2               1073807679               0               4               1               1               0               415               348                mtp       16387 ALIGN TIMER 2 EXPIRED iacSt=8 (Lnk 1)
    
    
    xx               2010-06-21 13:25:23               2               1073807679               0               4               1               1               0               415               348                mtp       16387 Sent SIOS (Lnk 1) (AlignNP in InitialAlign)
    That's how the loaded hex of the clob looks like:
    64 09 09 09 32 30 31 30 2D 30 36 2D 32 31 20 31 33 3A 32 35 3A 32 33 09 09 09 32 09 09 09 31 30 37 33 38 30 37 36 37 39 09 09 09 30 09 09 09 34 09 09 09 31 09 09 09 31 09 09 09 30 09 09 09 34 31 35 09 09 09 33 34 38 09 09 09 20 6D 74 70 20 20 20 20 20 20 20 31 36 33 38 37 20 41 4C 49 47 4E 20 54 49 4D 45 52 20 32 20 45 58 50 49 52 45 44 20 69 61 63 53 74 3D 38 20 28 4C 6E 6B 20 31 29 0A 0A 0A 78 78 09 09 09 32 30 31 30 2D 30 36 2D 32 31 20 31 33 3A 32 35 3A 32 33 09 09 09 32 09 09 09 31 30 37 33 38 30 37 36 37 39 09 09 09 30 09 09 09 34 09 09 09 31 09 09 09 31 09 09 09 30 09 09 09 34 31 35 09 09 09 33 34 38 09 09 09 20 6D 74 70 20 20 20 20 20 20 20 31 36 33 38 37 20 53 65 6E 74 20 53 49 4F 53 20 28 4C 6E 6B 20 31 29 20 28 41 6C 69 67 6E 4E 50 20 69 6E 20 49 6E 69 74 69 61 6C 41 6C 69 67 6E 29 0A 0A 0A 
    You can see that there is a total of 6 '0 a' or 6 new lines. However, I get the following results:
    select regexp_count(outputrow,'[[:cntrl:]]') control,regexp_count(outputrow,'[[:space:]]') space, regexp_count(outputrow,'[\n]') backslash_n, regexp_count(outputrow,'[\x0A]') x0A  
    from BULK_BAD_FILE_EXTERNAL b;
       CONTROL      SPACE BACKSLASH_N        X0A
    ---------- ---------- ----------- ----------
            72        104           9         22
    what I am doing wrong?

    11g is not yet I'd

    select length(outputrow) - length(replace(outputrow,chr(10))) num_of_rows
      from bulk_bad_file_external
    

    Concerning

    Etbin

  • ORA-00600: internal error code, arguments: [qmcxeExUseLoc93] with xmltable and big bows in the CLOB column

    Hi all

    Running the following:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    PL/SQL Release 11.2.0.2.0 - Production

    "CORE 11.2.0.2.0 Production."

    AMT for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Create a view of a relational table and XMLTABLE and extract nodes from voluminous of the xmltable, mapped text using COLUMNS. I concatenate the text nodes in an xml element in the XQuery xmltable, simple sequencing:

    <CONTENT>
    {$i/summary/text(),$i/know/text(),$i/considerations/text(),$i/look_for/text(),
    $i/nc//text(),$i/level1//text(),$i/level2//text(),$i/ipocc//text()}
    </CONTENT>
    

    SQLDeveloper query execution and right on when I scroll the 50th outcome accordingly set or... DB connection is closed and stack following error appears:

    [ORA-00600: internal error code, arguments: [qmcxeExUseLoc93], [], [], [], [], [], [], [], [], [], []]

    00600 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s] '.

    * Cause: It's the generic internal error for Oracle program number

    exceptions.    This indicates that a process has encountered a

    Exceptional condition.

    * Action: Report as a bug - the first argument is the internal error number

    I went site Oracle Support to use the 'search' for these types of errors, but he found nothing to the argument: "qmcxeExUseLoc93"... any ideas short of opening an SR with Oracle support? S/n reports that no problems with memory or tablespace... trace files report a stack trace is complete:

    [ORA-00600: internal error code, arguments: [qmcxeExUseLoc93], [], [], [], [], [], [], [], [], [], []]

    = Dump for incident 32114 (ORA 600 [qmcxeExUseLoc93]) =.

    2014-04-08 07:31:51.369

    dbkedDefDump(): from the default crash dumps (flags = 0x2, level = 3, mask = 0 x 0)

    -Run SQL statement for the current session (sql_id = 0qn4zxr0stgjh).

    SELECT ID, CONTENT of ort_active_content_en_vw

    -Call trace stack memory-

    call call entered the argument values in hex

    location point type (? means dubious value)

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

    skdstdst () + 40 bl 107ca 9980 FFFFFFFFFFD99A8? 000002004?

    000000001? 000000003?

    000000000? 000000002?

    000000001? 000000000?

    ksedst1 () + 104 call skdstdst() FFFFFFFFFFD89B0? 000002004?

    110641000? 1098C 1164?

    110641000? 000000000?

    FFFFFFFFFFD8AE0? 700000007?

    ksedst () + 40 call ksedst1() 3030000000000? 002050033?

    1098C 1158? 700000000025C?

    000000000? 000000000?

    1098C07B8? 000000000?

    dbkedDefDump (+ 2828) call ksedst() FFFFFFFFFFD8B90? 000000000?

    000000000? 000000000?

    000000000? 000000000?

    000000000? 300000003?

    …….

    -Binary stack dump-

    = FRAME [1] (skdstdst () + 40 - > 107ca 9980) =.

    defined by pointers frame 0xffffffffffd88b0 and 0xffffffffffd8840

    CALL TYPE: bl ERROR REPORTED: no COMPONENT: (null)

    0xffffffffffd8840 to 0xffffffffffd88b0 memory dump

    FFFFFFFFFFD8840 0FFFFFFF FFFD88B0 42422220 098C 1158 [...] BB '... X]

    08EBE70C FFFFFFFFFFD8850 00000001 00000001 10641000 [... d..]

    FFFFFFFFFFD8860 00000000 00000000 0FFFFFFF FFFD89E8 [...]

    FFFFFFFFFFD8870 0FFFFFFF FFFD99A8 00000000 00002004 [...].

    FFFFFFFFFFD8880 00000003 00000000 00000000 00000001 [...]

    FFFFFFFFFFD8890 00000000 00000000 00000000 00000002 [...]

    FFFFFFFFFFD88A0 00000000 00000001 00000000 00000000 [...]

    = SETTING [2] (ksedst1 () + 104-> skdstdst()) =.

    defined by pointers frame 0xffffffffffd89b0 and 0xffffffffffd88b0

    TYPE of CALL: call ERROR REPORTED: no COMPONENT: KSE

    0xffffffffffd88b0 to 0xffffffffffd89b0 memory dump

    FFFFFFFFFFD88B0 0FFFFFFF FFFD89B0 42422220 10317 68 A... 1zh BB"]

    FFFFFFFFFFD88C0 1033F758 00000001 00000001 0014963C [... <...] 3.X]

    FFFFFFFFFFD88D0 09ED0CA9 1873F04F 28422848 73743231... Sagna (B (Hst21]

    FFFFFFFFFFD88E0 0FFFFFFF FFFD89B0 00000000 00002004 [...].

    FFFFFFFFFFD88F0 00000001 00000001 10641000 098C 1164 [... d...d]

    FFFFFFFFFFD8900 00000001 10641000 00000000 00000000 [... d...]

    ……

    -Status of the Dump process (2).

    ===================================================

    STATE OF THE PROCESS

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

    Global information process:

    process: 0x700000012b18de8, call: 0x70000000b880ee0, xact: 0x0, curses: 0x700000012bf11f0, usrses: 0x700000012bf11f0

    in_exception_handler: no

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

    SO: 0x700000012b18de8, type: 2, owner: 0x0, flag: INIT /-/-/ 0x00 if: 0 x 3 c: 0 x 3

    proc = 0x700000012b18de8, name = process, queue = ksu.h LINE: 12451 ID:, pg = 0

    (process) Oracle pid:42, ser:153, called heart/high: 0x70000000b880ee0/0x70000000b880ee0

    flags: (0x0).

    Flags2: (0 x 800), flags3: (0x0)

    Intr error: call error 0,: 0, sess error: error of txn, 0, 0

    queue intr: vacuum

    ksudlp FALSE to the location: 0

    (post info) last message received: 0 0 0

    Last message received-card: no post

    last process affect me: no

    Last message sent: 0 0 26

    Last message sent-map: ksa2.h LINE: 282 ID:ksasnd

    last process posted by me: 6 1 700000012af9058

    (info from latch) wait_event = 0 bits = 0

    Process group: by DEFAULT, proc pseudo: 0x700000012b4db88

    Info of the o/s: user: tst214, duration: UNKNOWN, ospid: 4370650

    OSD pid Info: Unix process pid: 4370650, image: oracle@mldb2385

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

    SO: 0x700000010430ba0, type: 10, owner: 0x700000012b18de8, flag: INIT /-/-/ 0x00 if: c: 0x1 0x1

    proc = 0x700000012b18de8, name = FileOpenBlock, leader is ksfd.h LINE: 6337 ID:, pg = 0

    (FOB) flags = 2050 fib = 700000010de3758 incno = 0 waiting for IO cnt = 0

    fname=/tst214_01/oradata/TST214/temp01.dbf

    FNO = 201 lblksz = 8192 fsiz = 36608

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

    SO: 0 x 700000010430578, type: 10, owner: 0x700000012b18de8, flag: INIT /-/-/ 0x00 if: c: 0x1 0x1

    proc = 0x700000012b18de8, name = FileOpenBlock, leader is ksfd.h LINE: 6337 ID:, pg = 0

    (FOB) flags = 2050 fib = 700000010de2b40 incno = 0 waiting for IO cnt = 0

    fname=/tst214_03/oradata/TST214/ort_data01.dbf

    FNO = 6 lblksz = 8192 fsiz = 25600

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

    SO: 0x70000001042ff38, type: 10, owner: 0x700000012b18de8, flag: INIT /-/-/ 0x00 if: c: 0x1 0x1

    proc = 0x700000012b18de8, name = FileOpenBlock, leader is ksfd.h LINE: 6337 ID:, pg = 0

    (FOB) flags = 2050 fib = 700000010de1310 incno = 0 waiting for IO cnt = 0

    fname=/tst214_01/oradata/TST214/sysaux01.dbf

    FNO = 2 lblksz = 8192 fsiz = 89600

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

    SO: 0x70000001042f910, type: 10, owner: 0x700000012b18de8, flag: INIT /-/-/ 0x00 if: c: 0x1 0x1

    proc = 0x700000012b18de8, name = FileOpenBlock, leader is ksfd.h LINE: 6337 ID:, pg = 0

    (FOB) flags = 2050 fib = 700000010de0d10 incno = 0 waiting for IO cnt = 0

    fname=/tst214_01/oradata/TST214/System01.dbf

    FNO = 1 lblksz = 8192 fsiz = 96000

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

    SO: 0x700000012bf11f0, type: 4, owner: 0x700000012b18de8, flag: INIT /-/-/ 0x00 if: 0 x 3 c: 0 x 3

    proc = 0x700000012b18de8, name = session, lead = ksu.h LINE: 12459 ID:, pg = 0

    (session) sid: 41 ser: 1263 trans: 0x0, creator: 0x700000012b18de8

    indicators: (0 x 8000045) USR /-flags_idl: (0 x 1) BSY /-/ - /-/ - / -.

    Flags2: (0 x 40008) - / -.

    DID:, DID in the short term:

    TXN branch: 0x0

    Oct: 3, prv: 0, sql: 0x70000000c59dbd0, psql: 0x70000000b196c38, user: 73/ORT_READ

    ksuxds FALSE to the location: 0

    name of the service: the USERS of SYS$

    Customer details:

    Info of the o/s: user: norman.jonker, duration: unknown, ospid: 6224

    machine: G4021165 program: SQL Developer

    application name: SQL Developer, hash value = 1012150930

    Battery active waiting:

    No waiting; last waiting ended 2,617517 sec ago

    Wait state:

    fixed_waits = 0 flags = 0 x 21 limit = 0 x 0 /-1

    History of waiting for session:

    elapsed time of 2,617552 sec from last wait

    0: waiting for 'direct path read '.

    number = 0 x 6, first s/n = 0 x 2901, block cnt = 0 x 2

    wait_id = 2222 seq_num = 2223 snap_id = 1

    wait time: snap = 0,000035 s, exc = 0,000035 s, total s = 0,000035

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,029003 seconds time elapsed

    1: expected "asynch descriptor resize.

    #aio in circulation = 0 x 0, the current limit of aio = 0xc8, this capping aio = 0 x 145

    wait_id = 2221 seq_num = 2222 snap_id = 1

    wait time: snap = 0,000003 s, exc = 0,000003 s, total s = 0,000003

    wait time: max = 307445734561 min 49sec

    wait charges: calls = 0 os = 0

    After 0,000710 seconds time elapsed

    "2: expected ' SQL * Net message to client"

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2220 seq_num = 2221 snap_id = 1

    wait time: snap = 0,000005 dry, exc = 0,000005, total = 0,000005 sec

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,001452 seconds time elapsed

    3: expected ' SQL * Net client message'

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2219 seq_num = 2220 snap_id = 1

    wait time: snap = 0,499033 s, exc = 0,499033 s, total s = 0,499033

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,000034 seconds time elapsed

    "4: expected ' SQL * Net message to client"

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2218 seq_num = 2219 snap_id = 1

    wait time: snap = 0,000003 s, exc = 0,000003 s, total s = 0,000003

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,000048 seconds time elapsed

    5: expected ' SQL * Net client message'

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2217 seq_num = 2218 snap_id = 1

    wait time: snap = 0,061319 s, exc = 0,061319 s, total s = 0,061319

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,000028 seconds time elapsed

    "6: expected ' SQL * Net message to client"

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2216 seq_num = snap_id 2217 = 1

    wait time: snap = 0,000003 s, exc = 0,000003 s, total s = 0,000003

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,000048 seconds time elapsed

    7: expected ' SQL * Net client message'

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2215 seq_num = 2216 snap_id = 1

    wait time: snap = 0,063435 s, exc = 0,063435 s, total s = 0,063435

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,000045 seconds time elapsed

    "8: expected ' SQL * Net message to client"

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2214 seq_num = 2215 snap_id = 1

    wait time: snap = 0,000003 s, exc = 0,000003 s, total s = 0,000003

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,000070 seconds time elapsed

    9: expected ' SQL * Net client message'

    pilot-id = 0 x 54435000, #bytes = 0 x 1, = 0x0

    wait_id = 2213 seq_num = 2214 snap_id = 1

    wait time: snap = 0,060780 s, exc = 0,060780 s, total s = 0,060780

    wait time: max = infinite

    wait charges: calls = 0 os = 0

    After 0,000030 seconds time elapsed

    The Session history sampled session 1263 series 41

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

    History of the sampled session is built by sampling

    the session target all the 1 second. The sampling process

    capture to each sample, if the session is in an active waiting.

    a wait inactive, or not in a wait. If the session is in a

    active wait interval then one is indicated for all samples

    the session was in the same active waiting. If the

    session is in an inactive waiting or not waiting for

    consecutive samples then one interval is indicated for all

    consecutive samples. If we post these consecutive

    samples in a single interval session may NOT be permanently

    inactive or not in a wait (the sampling process is unclear).

    The history is displayed in reverse chronological order.

    sampling interval: 1 s, max 120 sec history

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

    [3 samples, 07:31:51 - 07: 31:53]

    not waiting at each sample

    [18 samples, 07:31:33 - 07: 31:50]

    waiting in each sample slowed

    [2 samples, 07:31:31 - 07: 31:32]

    not waiting at each sample

    [42 samples, 07:30:49 - 07:31:30]

    waiting in each sample slowed

    [4 biopsies, 07:30:45 - 07: 30:48]

    not waiting at each sample

    [7 samples, 07:30:38 - 07: 30:44]

    waiting in each sample slowed

    [sample 1, 07:30:37]

    waited for ' SQL * Net break/reset for customer ', seq_num: 1149

    P1: 'driver id' = 0 x 54435000

    P2: 'pause '? = 0 x 0

    P3: "= 0x0

    time_waited: 0,013444 sec (sampling interval: 0 sec)

    [14 samples, 07:30:23 - 07: 30:36]

    waiting in each sample slowed

    [4 biopsies, 07:30:19 - 07: 30:22]

    not waiting at each sample

    [26 samples, 07:29:53 - 07:30:18]

    waiting in each sample slowed

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

    History of the sampled plenary:

    longest_non_idle_wait: ' SQL * Net break/reset for customer '

    [sample 1, 07:30:37]

    time_waited: 0,013444 sec (sampling interval: 0 sec)

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

    the temporary object counter: 2

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

    Virtual discussion:

    kgskvt: 700000011f06658, sess: 700000012bf11f0 sid: 41 ser: 1263

    VC: 0, proc: 700000012b18de8, id: 41

    News consumer group: OTHER_GROUPS (upd? 0) maps: DEFAULT_CONSUMER_GROUP, orig:

    vt_state: 0x100, vt_flags: 0xA030, blkrun: 0, numa: 1

    inwait: 0

    place where last insched series: kgskthrrun

    place where insched last reset: kgskthrrun2

    place where inwait the last value: NULL

    place where inwait last reset: kgskbindfast

    is_assigned: 1, in_sched: 0 (0)

    QCLs: 0, qlink: FALSE

    vt_active: 0 (pending: 1).

    vt_pq_active: 0, dop: 0

    used quanta: 0 (cg: 0) usec, num penalty: 0

    start of CPU time: 0

    idle time: 0, time: 0 (cg: 0)

    yields of processor: 0 (cg: 0), expected: 0 (cg: 0), wait time: 0 (cg: 0) usec

    e/s expected: 0 (cg: 0), wait time: 0 (cg: 0) usec

    ASL in queue wait times: 0, time: 0 (NEWS 0, 0 cg)

    PQQ in queue wait times: 0, time: 0 (NEWS 0, 0 cg)

    Violation of the time to wait in queue: 0

    aborted calls: 0, num is exec hit limit: 0

    Cancel current: max k 0: 0 k

    I/O credits: small = 0 General = 0

    I/O waiting credits: small = 0 General = 0

    KTU Session Commit Cache Dump for IDLs:

    XID: 0x0009.008.00002025 RCS: flg 0x0000.00cd4e90 = 0x1

    XID: 0x0006.018.00001f5a RCS: flg 0x0000.00cd4e90 = 0x1

    XID: 0x0009.015.00002024 RCS: flg 0x0000.00cd4e90 = 0x1

    XID: 0x0005.004.00001f30 RCS: flg 0x0000.00cd4e90 = 0x1

    XID: 0x0006.021.000011ed RCS: flg 0x0000.00cd4e90 = 0x1

    KTU Session Commit Cache Dump for Non-IDLs:

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

    KKS - UOL used: 0 locks (used = 19, free = 3)

    KGX atomic operation Log 70000000b30a840

    Mutex 0 (0, 0) oper idn 0 NONE

    Cursor Parent uid 41 DTS 4 w/h 7 slp 0

    Oper = pt1 NONE = 0 pt2 pt3 0 = 0 =

    PT4 = 0 = 0 = 0 stt u41

    KGX atomic operation Log 70000000b30a890

    Mutex 0 (0, 0) oper idn 0 NONE

    parasite of the slp whr 6 table uid 41 DTS torrent 4 0

    Oper = NONE pt1 = 70000000d1485e8 pt2 = pt3 148678 = 0 70000000d

    PT4 = 0 = 0 = 0 stt u41

    KGX atomic operation Log 70000000b30a8e0

    Mutex 0 (0, 0) oper idn 0 NONE

    FSO uid 41 DTS mutex 0 w/h 0 slp 0

    KGX atomic operation Log 70000000b30a930

    Mutex 0 (0, 0) oper idn 0 NONE

    FSO uid 41 DTS mutex 0 w/h 0 slp 0

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

    KGL - UOL SO Cache (total = 182, free = 107)

    KGX atomic operation Log 70000000 b 045538

    Mutex 0 (0, 0) oper idn 0 NONE

    Library Cache uid 41 DTS 5 w/h 85 slp 0

    Oper = 0 = 70000000b 227350 pt2 = pt3 = 0 70000000c5df180 pt1

    PT4 = 0 = 0 = 0 ub4 pt5

    KGX atomic operation Log 70000000 b 045590

    Mutex (0, 0) 70000000c5b11d8 idn 69fd5d60 oper NONE

    Library Cache uid 41 DTS 4 w/h 77 slp 0

    Oper = pt1 pt2 70000000934fb60 0 = = 0 = 0 pt3

    PT4 = 0 = 0 = 0 ub4 pt5

    KGX atomic operation Log 70000000b0455e8

    Mutex 0 (0, 0) oper idn 0 NONE

    Library Cache uid 41 DTS 4 w/h 79 slp 0

    Oper = 0 = 70000000b 225950 pt2 = pt3 = 0 70000000c382cb8 pt1

    PT4 = 0 = 0 = 0 ub4 pt5

    KGX atomic operation Log 70000000 b 045640

    Mutex (0, 0) 70000000b225a80 idn ae8e84f6 oper NONE

    Library Cache uid 41 DTS 4 w/h 70 slp 0

    Oper = 0 = 70000000b 225950 pt2 = 0 = 0 pt3, pt1

    PT4 = pt5 0 = 0 ub4 = 4

    KGX atomic operation Log 70000000 b 045698

    Mutex (0, 0) 70000000b225a80 idn ae8e84f6 oper NONE

    Library Cache uid 41 DTS 4 w/h 70 slp 0

    Oper = 0 = 70000000b 225950 pt2 = 0 = 0 pt3, pt1

    PT4 = 0 = 0 = 0 ub4 pt5

    KGX atomic operation Log 70000000b0456f0

    Mutex 0 (0, 0) oper idn 0 NONE

    Library Cache 41 DTS uid 0 w/h 0 slp 0

    Oper = pt1 pt2 = pt3 0 = 0 0 = 0

    PT4 = 0 = 0 = 0 ub4 pt5

    KGX atomic operation Log 70000000 b 045748

    Mutex 0 (0, 0) oper idn 0 NONE

    Library Cache 41 DTS uid 0 w/h 0 slp 0

    Oper = pt1 pt2 = pt3 0 = 0 0 = 0

    PT4 = 0 = 0 = 0 ub4 pt5

    KGL SO hide

    SO = 70000000c5df180 link = 70000000c5df1f0 [70000000b115e38, b 70000000, 045520]

    FLG = 8000 use its 700000012bf11f0 = 700000012bf11f0 =

    SO = 70000000b115dc8 link = 70000000b115e38 [70000000c5df380, 70000000c5df1f0]

    FLG = 8000 use its 700000012bf11f0 = 700000012bf11f0 =

    SO = 70000000c5df310 link = 70000000c5df380 [70000000c7abab8, 70000000b115e38]

    FLG = 8000 use its 700000012bf11f0 = 700000012bf11f0 =

    Hello

    I'm not saying that it will solve the problem, but you must use XMLCast in this case, not XMLSerialize.

    Try also with fn:local - name instead (unless you need information namespace as well):

    Select (xmlcast)

    XMLQUERY)

    "for $dcrContent in fn:collection("oradb:/PUBLIC/DATA_CAPTURE_RECORD_CONTENT") / ROW.

    where $dcrContent/DATA_CAPTURE_RECORD_CONTENT_ID = xs:decimal ($id)

    "return fn:local - name($dcrContent/CONTENT_XML/*)"

    from 608 as "id".

    contents of return

    )

    as varchar2 (100)

    )

    Double;

  • How repeat/option output values from XML in the CLOB column?

    Environment:


    Oracle 11.2.0.3 EE on Solaris


    Very much a newbie XML but try.  :-)


    I have a table with the XML stored in a CLOB (no, I can't imagine the environment but I live here).


    I need to display the data in a flat file format.  Some of the data is both optional and possibly repeat if present.


    Here's a fun sample data:


    "< res: customers xmlns: res = ' http://www.whatever.com/response ">

    < res: lastName > SMITH < / res: lastName >

    < res: firstName > JENNIFER < / res: name >

    < res: Extras >

    < res: Extra >

    HOME < res: phoneType > < / res: phoneType >

    555-555-5555 < res: phoneNumber > < / res: phoneNumber >

    < / res: Extra >

    < res: Extra >

    < res: phoneType > MOBILE < / res: phoneType >

    666-666-6666 < res: phoneNumber > < / res: phoneNumber >

    < / res: Extra >

    < / res: Extras >

    < res: lastName > JONES < / res: name >

    < res: firstName > ROBERT < / res: name >

    < res: Extras >

    < res: Extra >

    HOME < res: phoneType > < / res: / phoneType >

    123-456-7890 < res: phoneNumber > < / res: phoneNumber >

    < / res: Extra >

    < / res: Extras >

    < res: lastName > MURPHY < / res: lastName >

    < res: firstName > SEAN < / res: name >

    < / res: customers >

    I'm trying to get my output to look like this:


    Last name first name model number

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

    JENNIFER SMITH 555-555-5555 HOME

    SMITH JENNIFER MOBILE 666-666-6666

    HOME OF ROBERT JONES 123-456-7890

    SEAN MURPHY


    I don't know how to get the repeated lines printed and I don't know how to get the printed line that does not contain the optional data.


    Here is the script that I have developed so far.  With my actual data I can get the printed name and I can get phone information printed out but only to the exclusion of the names. I was unable to get the data if the optional data is not present.


    I tried to refer to information from phone and then back up to 2 levels for the information of name but I receive: ORA-19110: no support for XQuery expression


    Select x.*

    client m.

    XMLTable (XMLNamespaces ('http://www.whatever.com/response' as "res") )

    , ' / res: clients/res: res/Extras: Extra '

    by the way of xmltype (m.CUSTOMER_XML)

    columns

    lastName varchar2 (80) WAY '... /... / res: LastName'

    , name varchar2 (30) WAY '... /... /FirstName'

    , varchar2 (30) phoneType PATH '.'

    , number of phone varchar2 (30) PATH '.'

    ) x

    Any help is greatly appreciated.


    -gary

    Hi Gary,.

    Are you sure the sample XML code correspond to your actual data?

    The second query expected error because the PATH expression refers to multiple targets.

    If it's really like that, the XML structure is not very easy to deal with. It would be wise to have a container element enclosing each customer information, like this:

    http://www.whatever.com/response">

    SMITH

    JENNIFER

    HOME

    555-555-5555.

    MOBILE

    666-666-6666.

    ...

    To answer your main question, you can use an OUTER JOIN to include data that do not have Extras.

    Using your original sample XML, something like this works for me:

    SQL > select x.lastName

    2, x.firstName

    3, y.phoneType

    4, y.phoneNumber

    client 5 m

    6, XMLTable)

    7 XMLNamespaces (default 'http://www.whatever.com/response')

    8, ' for $i in/clients/first name

    9 return element {} r

    $i 10 / following - sibling:Extras [1]

    11, $i/next - sibling:firstName [1]

    12          , $i

    13          }'

    14 passage xmltype (m.CUSTOMER_XML)

    15 columns

    lastName 16 varchar2 (80) PATH "lastName."

    17, firstName varchar2 (30) PATH "first name".

    18, extras xmltype PATH "Extras."

    (19) x

    20, XMLTable)

    21 XMLNamespaces (default 'http://www.whatever.com/response')

    22, ' / extras/Extra.

    23 passage x.extras

    24 columns

    VARCHAR2 (30) 25 phoneType PATH "phoneType".

    26, phoneNumber varchar2 (30) PATH "phone".

    27       ) (+) y

    28;

    LASTNAME FIRSTNAME PHONETYPE PHONENUMBER

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

    JENNIFER SMITH 555-555-5555 HOME

    SMITH JENNIFER MOBILE 666-666-6666

    HOME OF ROBERT JONES 123-456-7890

    SEAN MURPHY

  • How to create the default column in XML schema?

    Hi all

    I would like to define a default column Let's say Run_Date as Date data type in XML (XSD) schema definition and would fill column Run_Date SYSDATE, when XML documents are parsed to this schema.
    Let me know, how can we achieve?

    Thanks in advance.

    Also, I can not change the contents of the XML file, because it is generated by another language, but I can change the definition of XML schema, if necessary.

    Well, if you can not change the XML instance, you cannot change the schema, it conforms to the.
    You can add an optional attribute whose value by default, but we can only use a static value.

    How do you insert the file into the table?

  • If you programmatically, via an INSERT statement, then I think your best bet is to create a new table with a relational schema XMLType column and a DATE column:

    CREATE TABLE employees (
      dt_created date default sysdate not null
    , xmldoc     xmltype
    , CONSTRAINT emp_pk PRIMARY KEY (xmldoc."XMLDATA".EMP_NO)
    )
    XMLTYPE COLUMN xmldoc STORE AS OBJECT RELATIONAL
    XMLSCHEMA "EMP.xsd" ELEMENT "Emp" ;
    

    If you choose to do so, remove the XML schema and enter it again with "genTables-online false."

  • If you have inserted the file via the XDB (FTP, WebDAV, createResource) repository and relying on the table by default feature, then you may be out of luck.
    There is probably a way to tamper with the underlying structure of GOLD among a hidden column do accept a default value, but since it is not supported I won't even try.

  • 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.

Maybe you are looking for

  • Samsung note3 does not ring when you receive a call

    The new version of Skype is bad. My operating system is 4.4.2 kit kat almost 100% of the time Miss l name because it does not ring. When I make a call and do it on the loudspeaker, it just for no reason rebascule on the speaker internal and if I'm on

  • My xbox it said that all my friends are offline.

    OT: friends. My xbox I told all my friends are offline, but I was just in a game with one and now we cannot talk

  • MindJolt games on facebook

    Have always been able to play these games until this week.  When I go on facebook and choose mindjolt games and choose any game to play, it comes up with my score in the past and everyone who played, but the screen to play the game is black with a sm

  • Windows media player cannot find the file...

    After I burn a cd, and then try to play on the same pc that was used to burn, I get this message. "windows media player cannot find the file. If you try to read, burn or sync an item that is in your library, the element can point to a file that has b

  • How can IM connected to the wireless network, but not to the internet, I fix?

    my laptop can no longer connect to the internet, but for the wireless network I can view other computers on the network, but can't go on the internet it says unidentified network.I took all the troubleshooting steps to resolve this problem without su