Query XML(CLOB) datatype

Hello,
I am new to XML and have been trying this for few days and get no luck ...
First, I have an Excel file, which contains a list of bills for customers. It is a sample file to test my application.
In the future, my application will receive data of XML-datatype, so my job here is to import this Excel file into my Oracle database 11gr2, then transform it to XML datatype one.
I did import it by using Oracle SQL Developer and nicely stored it in a table called so_lieu.
After that, I run the following code to convert the table data to XML datatype:
CREATE TABLE xmlDoc(temp CLOB);
DECLARE
  qryCtx DBMS_XMLGEN.ctxHandle;
  temp CLOB;
BEGIN
  qryCtx := DBMS_XMLGEN.newContext('SELECT * FROM huy.so_lieu');
  -- Set the row header to be bill
  DBMS_XMLGEN.setRowTag(qryCtx, 'bill');
  -- Get the result
  temp := DBMS_XMLGEN.getXML(qryCtx);
  INSERT INTO xmlDoc VALUES(temp);
  --Close context
  DBMS_XMLGEN.closeContext(qryCtx);
END;
It is a success:
table XMLDOC created.
anonymous block completed
When I run: SELECT * from xmlDoc; I can get a data of XML-datatype as following:
<?xml version="1.0"?>
<ROWSET>
<bill>
  <MA_CQTT>5335</MA_CQTT>
  <ACCOUNT>P482668</ACCOUNT>
  <TEN_CQTT>Công ty TNHH FrieslandCampina Việt Nam</TEN_CQTT>
  <DIACHI>phường Bình Hòa, Thị xã Thuận An, Bình Dương</DIACHI>
  <MS_THUE>3700229344-   -</MS_THUE>
  <SDT>754422 ext 333</SDT>
  <LOAI_DV>48</LOAI_DV>
  <TEN>Mail - SMD</TEN>
  <CUOC_DV>0</CUOC_DV>
  <DC>0</DC>
  <CUOC_TBSD>0</CUOC_TBSD>
  <TRUY_THU>0</TRUY_THU>
  <TONG_TIEN>22254545</TONG_TIEN>
  <VAT>2225455</VAT>
</bill>
<bill>
  <MA_CQTT>90255</MA_CQTT>
  <ACCOUNT>P0421100</ACCOUNT>
  <TEN_CQTT>VPĐD HOME MERIDIAN INTERNATIONAL,INC TạI TP.HCM</TEN_CQTT>
  <DIACHI>Tầng trệt, Block C, Cao ốc An Khang, P. An Phú, Q.2, TP.HCM</DIACHI>
  <MS_THUE>0302199864-   -</MS_THUE>
  <SDT>838228511</SDT>
  <FAX>838293764</FAX>
  <LOAI_DV>7</LOAI_DV>
  <TEN>Internet trực tiếp</TEN>
  <CUOC_DV>0</CUOC_DV>
  <DC>0</DC>
  <CUOC_TBSD>35446000</CUOC_TBSD>
  <TRUY_THU>0</TRUY_THU>
  <TONG_TIEN>35446000</TONG_TIEN>
  <VAT>3544600</VAT>
</bill>
</ROWSET>
Then I try to select/query the XML elements inside that XML data (to parse them into another tables) but cannot. I tried:
SELECT XMLQuery('
    for $x in ora:view("xmlDoc")/ROW
       return $x/TEMP/ROWSET/bill/MA_CQTT
' RETURNING CONTENT) FROM DUAL;
It gave errors
ORA-19276: XPST0005 - XPath step specifies an invalid element/attribute name: (ROWSET)
19276. 00000 -  "XP0005 - XPath step specifies an invalid element/attribute name: (%s)"
*Cause:    The XPath step specified invalid element or attribute name that did not match any nodes according to the input XML schema or structure.
*Action:   Correct the element or attribute name as the name may be mis-spelled.
I read several threads and think that maybe my ROWSET element is not XML anymore. Thus, cannot select using XPath. How can I fix it?
Thank you in advance,
Huy Do.
PS: I tried using XMLTABLE as below:
SELECT x2.*
  from XMLDOC h,
    XMLTABLE(
      '//ROWSET/bill'
      PASSING xmltype(h.temp)
      COLUMNS ma_cqtt  varchar(20) path 'ma_cqtt'
      ) x2
The query gave me a table of 2566 row of "ma_cqtt" but their value are all "null" (excel file has 2566 rows of record)
Message was edited by: 2716502

Thank you Odie I tried:
INSERT INTO DM_TABLE (ma_cqtt, account, thang_ps)
    select x.ma_cqtt
         , x.account
         , thangps as thang
Of course it returned an error, how silly of me to complicate thing like that
And I have one more question about the speed to parse a xml data. Please, help me with it.
In my code, I usually store xml data as a row in a temporary table (table mau_so_lieu). Then when doing parsing, I call the xml data from that table and the processing time is usually ~0.5s only. The code is like below:
INSERT INTO mau_so_lieu VALUES(xmlData);
INSERT INTO DM (                         
                            ma_kh, account, thang_ps)
    select x.ma_kh, x.account, thang
      from mau_so_lieu m, xmltable
          ('//Bao_cuoc'
            passing m.BILL
            columns
               ma_kh varchar2(20) path '@ma_cqtt'
              , account varchar2(20) path '@account'
          ) x;
But one of my senior (SQL server expert) suggested to store xml data in a variable (xmlData XMLType) as he thought the processing time will be even shorter, as well as no temporary table needed (no trash left which need to be cleaned later). I tried that but somehow the processing time is > 5s with the code as below:
INSERT INTO DM (                         
                            ma_kh, account, thang_ps)
    select x.ma_kh, x.account, thang
      from xmltable
          ('//Bao_cuoc'
            passing xmlData
            columns
               ma_kh varchar2(20) path '@ma_cqtt'
              , account varchar2(20) path '@account'
          ) x;
Could you tell me why the processing time are so different? Is it because of the default RAM of Oracle XE 11g is too small to process?
Thank you very much,
Huy Do.

Similar Messages

  • Query xml data from a CLOB datatye

    All,
    I read in an oracle white paper that is is possible to query XML data from CLOB datatype using oracle text index using operators HASPATH() and INPATH(). I am not able to find any example on how to do this. Can someone please post a simple example here.
    Thank You very much!

    SCOTT@10gXE> CREATE TABLE your_table (id NUMBER, xml_data CLOB)
      2  /
    Table created.
    SCOTT@10gXE> INSERT INTO your_table (id, xml_data)
      2  SELECT t.deptno,
      3           DBMS_XMLGEN.GETXML
      4             ('SELECT d.dname,
      5                   CURSOR (SELECT e.ename, e.job
      6                        FROM   emp e
      7                        WHERE  e.deptno = d.deptno) emp_data
      8            FROM   dept d
      9            WHERE  d.deptno = ' || t.deptno)
    10  FROM   dept t
    11  /
    5 rows created.
    SCOTT@10gXE> COMMIT
      2  /
    Commit complete.
    SCOTT@10gXE> begin
      2    ctx_ddl.create_section_group('xmlpathgroup', 'PATH_SECTION_GROUP');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX myindex
      2  ON your_table(xml_data)
      3  INDEXTYPE IS ctxsys.context
      4  PARAMETERS ('datastore ctxsys.default_datastore
      5              filter ctxsys.null_filter
      6              section group xmlpathgroup'
      7            )
      8  /
    Index created.
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'PERSONNEL INPATH (//DNAME)') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//DNAME="PERSONNEL")') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'CLARK INPATH (//ENAME)') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//ENAME="CLARK")') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE>

  • QUERYING CLOB DATATYPE

    Hello Everyone,
    Before I go to my question let me give you the context. I wanted to upload the description of a set of products with their IDs into my database. Hence I created a table 'demo' with two columns of INT and CLOB datatypes using the following script. *create table demo ( id int primary key, theclob Clob );*
    Then I create a directory using the following script, *Create Or Replace Directory MY_FILES as 'C:\path of the folder.......\';*
    In the above mentioned directory I create one .txt file for each product with the description of the product. Using the below script I created a procedure to load the contents of the .txt files into my 'demo' table.
    *CREATE OR REPLACE*
    *PROCEDURE LOAD_A_FILE( P_ID IN NUMBER, P_FILENAME IN VARCHAR2 ) AS*
    *L_CLOB CLOB;*
    *L_BFILE BFILE;*
    *BEGIN*
    *INSERT INTO DEMO VALUES ( P_ID, EMPTY_CLOB() )*
    *RETURNING THECLOB INTO L_CLOB;*
    *L_BFILE := BFILENAME( 'MY_FILES', P_FILENAME );*
    *DBMS_LOB.FILEOPEN( L_BFILE );*
    *DBMS_LOB.LOADFROMFILE( L_CLOB, L_BFILE,*
    *DBMS_LOB.GETLENGTH( L_BFILE ) );*
    *DBMS_LOB.FILECLOSE( L_BFILE );*
    *END;*
    After which I called the procedure using, *exec load_a_file(1, 'filename.txt' );*
    When I queried the table like, select * from demo; I am getting the following output..... which is all fine.
    ID THECLOB
    1 "product x is an excellent way to improve your production process and enhance your turnaround time....."
    _*QUESTION*_
    When I did the exact same thing in my friend's machine and query the demo table, I get garbage value in the 'theclob' column (as shown below). The only difference is that mine is an enterprise edition of Oracle 11.2.0.1 and my friends is an Express edition of Oracle 11.2.0.2. Does this has anything to do with the problem?
    1 ⁦     猺⁁摶慮捥搠摡瑡潬汥捴楯渠捡灡扩汩瑩敳㨠扡牣潤攠獣慮湩湧Ⱐ灡湩挠慬敲琬⁷潲欠潲摥爠浡湡来浥湴Ⱐ睩牥汥獳⁦潲浳湤⁳異敲癩獯爠瑩浥⁥湴特⸊੃潭整⁍潢楬攠坯牫敲㨠周攠浯獴⁲潢畳琠灡捫慧攮⁐牯癩摥猠扵獩湥獳敳⁷楴栠愠捯浰汥瑥汹⁷楲敬敳猠潰敲慴楯湡氠浡湡来浥湴⁳祳瑥洮⁉湣汵摥猠慬氠潦⁃潭整⁔牡捫敲❳⁦敡瑵牥猠灬畳㨠䍡汥湤慲猬畴潭慴敤畳瑯浥爠捯浭畮楣慴楯湳Ⱐ睯牫牤敲⽩湶潩捥⁵灤慴楮朠晲潭⁴桥⁦楥汤Ⱐ睯牫牤敲⁳敱略湣楮本⁥硣敳獩癥⁳瑯瀠瑩浥汥牴猬⁷楲敬敳猠景牭猬⁴畲渭批⵴畲渠癯楣攠湡癩条瑩潮Ⱐ慮搠浯牥⸊ੁ摶慮捥搠坩
    2     ≁否吠潦晥牳摶慮捥搠睩牥汥獳⁦潲浳慰慢楬楴礠睩瑨⁃潭整⁅娠䍯浥琬⁔牡捫敲湤⁃潭整⁍潢楬攠坯牫敲ਊ䍯浥琠䕚㨠周攠浯獴⁲潢畳琬潳琠敦晥捴楶攠睥戠扡獥搠䵒䴠慰灬楣慴楯渠楮⁴桥⁩湤畳瑲礮⁃慰慢楬楴楥猠楮捬畤攠䝐匠汯捡瑩潮⁴牡捫楮本⁷楲敬敳猠瑩浥汯捫Ⱐ来漭晥湣楮朠睩瑨汥牴猬⁳灥敤湤⁳瑯瀠瑩浥汥牴猬湤渭摥浡湤爠獣桥摵汥搠牥灯牴楮朮ਊ䍯浥琠呲慣步爺⁁⁰潷敲晵氠捬楥湴ⵢ慳敤⁰污瑦潲洠瑨慴晦敲猠慬氠瑨攠晥慴畲敳映䍯浥琠䕚⁰汵猺⁁摶慮捥搠摡瑡潬汥捴楯渠捡灡扩汩瑩敳㨠扡牣潤攠獣慮湩湧Ⱐ灡湩挠慬敲琬⁷潲欠潲摥爠浡湡来浥湴Ⱐ睩牥汥獳⁦潲浳湤⁳異敲癩獯爠瑩浥⁥湴特⸊੃潭整⁍潢楬攠坯牫敲㨠周攠浯獴⁲潢畳琠灡捫慧攮⁐牯癩摥猠扵獩湥獳敳⁷楴栠愠捯浰汥瑥汹⁷楲敬敳猠潰敲慴楯湡氠浡湡来浥湴⁳祳瑥洮⁉湣汵摥猠慬氠潦⁃潭整⁔牡捫敲❳⁦敡瑵牥猠灬畳㨠䍡汥湤慲猬畴潭慴敤畳瑯浥爠捯浭畮楣慴楯湳Ⱐ睯牫牤敲⽩湶潩捥⁵灤慴楮朠晲潭⁴桥⁦楥汤Ⱐ睯牫牤敲⁳敱略湣楮本⁥硣敳獩癥⁳瑯瀠瑩浥汥牴猬⁷楲敬敳猠景牭猬⁴畲渭批⵴畲渠癯楣攠湡癩条瑩潮Ⱐ慮搠浯牥⸊ੁ摶慮捥搠坩牥汥獳⁆潲浳㨠呵牮湹⁰慰敲⁦潲洠楮瑯⁷楲敬敳猠捬潮攠潦⁴桥⁳慭攠楮景牭慴楯渠ⴠ湯慴瑥爠桯眠捯浰汩捡瑥搮⁓慶攠瑩浥礠瑲慮獦敲物湧⁩湦潲浡瑩潮慣欠瑯⁴桥晦楣攠睩瑨⁷楲敬敳猠獰敥搮⁓慶攠灡灥爠慮搠敬業楮慴攠摵慬•ഊ
    3     ≁䥒呉䵅⁍慮慧敲⁦牯洠䅔♔⁰牯癩摥猠愠浯扩汥灰汩捡瑩潮猠摥獩杮敤⁴漠瑲慣欠扩汬慢汥⁨潵牳⸠⁔桥⁁㑐⁳潬畴楯湳畴潭慴楣慬汹潧⁷楲敬敳猠敭慩氬慬汳Ⱐ慮搠扩汬慢汥⁥癥湴猬獳潣楡瑥猠瑨敭⁷楴栠捬楥湴爠灲潪散琠捯摥猠慮搠摩牥捴猠扩汬慢汥⁲散潲摳⁴漠扩汬楮朠獹獴敭献†周攠呩浥乯瑥⁳潬畴楯湳⁰牯癩摥⁳汩浭敤潷渠數灥物敮捥Ⱐ慬汯睩湧⁦潲牥慴楯渠潦慮畡氠扩汬慢汥⁥癥湴献†周敲攠慲攠瑷漠癥牳楯渠潦⁁㑐湤⁔業敎潴攮ਊ䭥礠䙥慴畲敳㨊⨠䥮捬畤攠捡灴畲攠慤⵨潣楬污扬攠敶敮瑳ਪ⁃慰瑵牥潢楬攠灨潮攠捡汬湤⁥浡楬†慳楬污扬攠敶敮瑳Ⱐਪ⁁扩汩瑹⁴漠慳獩杮楬污扬攠敶敮琠瑯汩敮琠慮搠灲潪散琊⨠䅢楬楴礠瑯⁳敡牣栠慮搠獣牯汬⁴桲潵杨楬污扬攠敶敮瑳Ⱐ潰瑩潮⁴漠楮瑥杲慴攠睩瑨楬汩湧⁳祳瑥浳 ⨠偯瑥湴楡氠扥湥晩瑳⁩湣汵摥⁩湣牥慳敤⁰牯摵捴楶楴礠慮搠牥摵捥搠慤浩湩獴牡瑩癥癥牨敡搠湤⁩湣牥慳敤⁲敶敮略略⁴漠浯牥捣畲慴攠捡灴畲楮朠潦楬污扬攠敶敮瑳•ഊ
    4     ≁灲楶慐慹⁁乄⁁灲楶慐慹⁐牯晥獳楯湡氠晲潭⁁否吠瑵牮⁹潵爠浯扩汥敶楣攠楮瑯⁰潲瑡扬攠捲敤楴慲搠瑥牭楮慬⸠坩瑨潭灡瑩扬攠䅔♔⁳浡牴灨潮攬⁁灲楶慐慹爠䅰物癡偡礠偲潦敳獩潮慬⁳潦瑷慲攬湤敲捨慮琠慣捯畮琬⁹潵爠浯扩汥⁷潲武潲捥慮⁰牯捥獳牥摩琠潲敢楴慲搠灡祭敮瑳⁦牯洠瑨攠晩敬搮ਊ䭥礠䙥慴畲敳㨠 ⨠卭慲瑰桯湥ⵢ慳敤⁳潬畴楯渠⁴漠灲潣敳猠捲敤楴慲搠灡祭敮瑳 ⨠䙵汬ⵦ敡瑵牥搠灯楮琭潦⵳慬攠獯汵瑩潮⁳異灯牴楮朠慬氠浡橯爠瑲慮獡捴楯渠瑹灥ਠ⨠卵灰潲瑳牥摩琠慮搠摥扩琠瑲慮獡捴楯湳 ਊ∍
    To make sure that the .txt files are accessible in the directory I executed the following script, Host Echo Hello World > C:\...path...\1.Txt
    After which I found the contents of the file changed to "Hello World". Later I loaded the .txt file with "Hello World" and queried the table. Still I am getting some garbage value. However since the string "Hello World" is much smaller than the previous contents, the garbage size is also smaller for ID 1. I don't get any errors, but you can see the output as follows.
    1      䠀攀氀氀漀 圀漀爀氀搀  ഀ਀
    2     ≁否吠潦晥牳摶慮捥搠睩牥汥獳⁦潲浳慰慢楬楴礠睩瑨⁃潭整⁅娠䍯浥琬⁔牡捫敲湤⁃潭整⁍潢楬攠坯牫敲ਊ䍯浥琠䕚㨠周攠浯獴⁲潢畳琬潳琠敦晥捴楶攠睥戠扡獥搠䵒䴠慰灬楣慴楯渠楮⁴桥⁩湤畳瑲礮⁃慰慢楬楴楥猠楮捬畤攠䝐匠汯捡瑩潮⁴牡捫楮本⁷楲敬敳猠瑩浥汯捫Ⱐ来漭晥湣楮朠睩瑨汥牴猬⁳灥敤湤⁳瑯瀠瑩浥汥牴猬湤渭摥浡湤爠獣桥摵汥搠牥灯牴楮朮ਊ䍯浥琠呲慣步爺⁁⁰潷敲晵氠捬楥湴ⵢ慳敤⁰污瑦潲洠瑨慴晦敲猠慬氠瑨攠晥慴畲敳映䍯浥琠䕚⁰汵猺⁁摶慮捥搠摡瑡潬汥捴楯渠捡灡扩汩瑩敳㨠扡牣潤攠獣慮湩湧Ⱐ灡湩挠慬敲琬⁷潲欠潲摥爠浡湡来浥湴Ⱐ睩牥汥獳⁦潲浳湤⁳異敲癩獯爠瑩浥⁥湴特⸊੃潭整⁍潢楬攠坯牫敲㨠周攠浯獴⁲潢畳琠灡捫慧攮⁐牯癩摥猠扵獩湥獳敳⁷楴栠愠捯浰汥瑥汹⁷楲敬敳猠潰敲慴楯湡氠浡湡来浥湴⁳祳瑥洮⁉湣汵摥猠慬氠潦⁃潭整⁔牡捫敲❳⁦敡瑵牥猠灬畳㨠䍡汥湤慲猬畴潭慴敤畳瑯浥爠捯浭畮楣慴楯湳Ⱐ睯牫牤敲⽩湶潩捥⁵灤慴楮朠晲潭⁴桥⁦楥汤Ⱐ睯牫牤敲⁳敱略湣楮本⁥硣敳獩癥⁳瑯瀠瑩浥汥牴猬⁷楲敬敳猠景牭猬⁴畲渭批⵴畲渠癯楣攠湡癩条瑩潮Ⱐ慮搠浯牥⸊ੁ摶慮捥搠坩牥汥獳⁆潲浳㨠呵牮湹⁰慰敲⁦潲洠楮瑯⁷楲敬敳猠捬潮攠潦⁴桥⁳慭攠楮景牭慴楯渠ⴠ湯慴瑥爠桯眠捯浰汩捡瑥搮⁓慶攠瑩浥礠瑲慮獦敲物湧⁩湦潲浡瑩潮慣欠瑯⁴桥晦楣攠睩瑨⁷楲敬敳猠獰敥搮⁓慶攠灡灥爠慮搠敬業楮慴攠摵慬•ഊ
    3     ≁䥒呉䵅⁍慮慧敲⁦牯洠䅔♔⁰牯癩摥猠愠浯扩汥灰汩捡瑩潮猠摥獩杮敤⁴漠瑲慣欠扩汬慢汥⁨潵牳⸠⁔桥⁁㑐⁳潬畴楯湳畴潭慴楣慬汹潧⁷楲敬敳猠敭慩氬慬汳Ⱐ慮搠扩汬慢汥⁥癥湴猬獳潣楡瑥猠瑨敭⁷楴栠捬楥湴爠灲潪散琠捯摥猠慮搠摩牥捴猠扩汬慢汥⁲散潲摳⁴漠扩汬楮朠獹獴敭献†周攠呩浥乯瑥⁳潬畴楯湳⁰牯癩摥⁳汩浭敤潷渠數灥物敮捥Ⱐ慬汯睩湧⁦潲牥慴楯渠潦慮畡氠扩汬慢汥⁥癥湴献†周敲攠慲攠瑷漠癥牳楯渠潦⁁㑐湤⁔業敎潴攮ਊ䭥礠䙥慴畲敳㨊⨠䥮捬畤攠捡灴畲攠慤⵨潣楬污扬攠敶敮瑳ਪ⁃慰瑵牥潢楬攠灨潮攠捡汬湤⁥浡楬†慳楬污扬攠敶敮瑳Ⱐਪ⁁扩汩瑹⁴漠慳獩杮楬污扬攠敶敮琠瑯汩敮琠慮搠灲潪散琊⨠䅢楬楴礠瑯⁳敡牣栠慮搠獣牯汬⁴桲潵杨楬污扬攠敶敮瑳Ⱐ潰瑩潮⁴漠楮瑥杲慴攠睩瑨楬汩湧⁳祳瑥浳 ⨠偯瑥湴楡氠扥湥晩瑳⁩湣汵摥⁩湣牥慳敤⁰牯摵捴楶楴礠慮搠牥摵捥搠慤浩湩獴牡瑩癥癥牨敡搠湤⁩湣牥慳敤⁲敶敮略略⁴漠浯牥捣畲慴攠捡灴畲楮朠潦楬污扬攠敶敮瑳•ഊ
    4     ≁灲楶慐慹⁁乄⁁灲楶慐慹⁐牯晥獳楯湡氠晲潭⁁否吠瑵牮⁹潵爠浯扩汥敶楣攠楮瑯⁰潲瑡扬攠捲敤楴慲搠瑥牭楮慬⸠坩瑨潭灡瑩扬攠䅔♔⁳浡牴灨潮攬⁁灲楶慐慹爠䅰物癡偡礠偲潦敳獩潮慬⁳潦瑷慲攬湤敲捨慮琠慣捯畮琬⁹潵爠浯扩汥⁷潲武潲捥慮⁰牯捥獳牥摩琠潲敢楴慲搠灡祭敮瑳⁦牯洠瑨攠晩敬搮ਊ䭥礠䙥慴畲敳㨠 ⨠卭慲瑰桯湥ⵢ慳敤⁳潬畴楯渠⁴漠灲潣敳猠捲敤楴慲搠灡祭敮瑳 ⨠䙵汬ⵦ敡瑵牥搠灯楮琭潦⵳慬攠獯汵瑩潮⁳異灯牴楮朠慬氠浡橯爠瑲慮獡捴楯渠瑹灥ਠ⨠卵灰潲瑳牥摩琠慮搠摥扩琠瑲慮獡捴楯湳 ਊ∍
    Edited by: Arunkumar Gunasekaran on Jan 3, 2013 11:38 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    >
    To make sure that the .txt files are accessible in the directory I executed the following script, Host Echo Hello World > C:\...path...\1.Txt
    After which I found the contents of the file changed to "Hello World". Later I loaded the .txt file with "Hello World" and queried the table. Still I am getting some garbage value. However since the string "Hello World" is much smaller than the previous contents, the garbage size is also smaller for ID 1. I don't get any errors, but you can see the output as follows.
    >
    The most common problem I have seen using BFILEs is the character set; BFILEs do NOT handle character set conversion.
    That is the main reason I don't recommend using BFILEs for loading data like this. Either SQL*Loader or external tables can do the job and they both handle character set conversions properly.
    See the LOADFROMFILE Procedure of DBMS_LOB package in the PL/SQL Language doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_lob.htm#i998778
    >
    Note:
    The input BFILE must have been opened prior to using this procedure. No character set conversions are performed implicitly when binary BFILE data is loaded into a CLOB. The BFILE data must already be in the same character set as the CLOB in the database. No error checking is performed to verify this.
    Note:
    If the character set is varying width, UTF-8 for example, the LOB value is stored in the fixed-width UCS2 format. Therefore, if you are using DBMS_LOB.LOADFROMFILE, the data in the BFILE should be in the UCS2 character set instead of the UTF-8 character set. However, you should use sql*loader instead of LOADFROMFILE to load data into a CLOB or NCLOB because sql*loader will provide the necessary character set conversions.
    >
    I suggest you use an external table definition to do this load. You can do an ALTER to change the file name for each load.
    See External Tables Concepts in the Utilities doc for the basics
    http://docs.oracle.com/cd/B28359_01/server.111/b28319/et_concepts.htm
    See Altering External Tables in the DBA doc for detailed information
    http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables013.htm
    >
    DEFAULT DIRECTORY
    Changes the default directory specification
    ALTER TABLE admin_ext_employees
    DEFAULT DIRECTORY admin_dat2_dir;
    LOCATION
    Allows data sources to be changed without dropping and re-creating the external table metadata
    ALTER TABLE admin_ext_employees
    LOCATION ('empxt3.txt',
    'empxt4.txt');
    >
    You can also load in parallel if you have licensed that option.

  • Load Clob datatype into xml db

    Hi All,
    Please can I know how to load clob datatype in xml database.
    In Oracle Data Integrator mapping, my source is clob column and  target is xml db.
    I get error “incompatible data type in conversion”.
    Please can I get some help in resolving the issue.
    Thanks.

    Also tried
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/t_xml.htm
    getStringVal funtion
    but it cannot handle more than 4000 characters.
    Please can I know how to map clob source to xml db in ODI

  • How to query XML data stored in a CLOB column

    I don't know XMLDB, so I have a dumb question about querying XML data which is saved as CLOB in a table.
    I have a table (OLAP_AW_PRC), with a CLOB column - AW_XML_TMPL_VAL
    This column contains this xml data - [click here|http://www.nasar.net/aw.xml]
    Now I want to query the data using the xml tags - like returning the name of AW. This is where I am having trouble, how to query the data from AW_XML_TMPL_VAL clob column.
    The following query generates error:
    ORA-31011: XML parsing failed.
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    SELECT
    extractValue(value(x), '/AW/LongName') as "AWNAME"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/Name') = 'OMCR4'
    - Nasar

    Mark,
    Thanks. This is exactly what I was looking for.
    After doing @Name in both places (SELECT and WHERE clause) it worked.
    Now I have one more question.
    There are multiple DIMENSION tags in my xml, and I want to see the NAME attribute values for all of those DIMENSIONs. The following query returns
    ORA-19025: EXTRACTVALUE returns value of only one node.
    Cause: Given XPath points to more than one node.
    Action: Rewrite the query so that exactly one node is returned.
    SELECT
    extractValue(value(x), '/AW/@Name') as "AW",
    extractValue(value(x), '/AW/Dimension/@Name') as "DIMENSIONS"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/@Name') = 'OMCR4'

  • Can we check CLOB datatype to null?

    Hi ,
    i want check clob datatype to null so i have used decode(col1,null,n1,n2) ..it executes the query but it gives nothing ..doesn't return data only show o ..
    can you please tell me how to do ?

    Take a look at http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_lob.htm#ARPLS66622
    CONVERTTOBLOB Procedure
    Regards
    Etbin

  • A clob datatype and LogMiner question?

    HI,
    I am using Logminer to caputer all DMLs agaist rows with clob datatype, find a problem.
    --log in as scott/tiger
    conn scott/tiger
    SQL> desc clobtest
    Name Null? Type
    SNO NUMBER
    CLOBTYPE CLOB
    --make a update
    update clobtest set CLOBTYPE = 'Hello New York' where sno = 11;
    commit;
    after using LogMiner to analyze redo log files, to query.
    select sql_redo from v$logmnr_contents where username = 'SCOTT';
    update "SCOTT"."CLOBTEST" set "CLOBTYPE" = 'Hello New York' where and ROWID = 'AAD0ZqAAEAAAAhsAAC';
    My quesion:
    As to caputured DML
    update "SCOTT"."CLOBTEST" set "CLOBTYPE" = 'Hello New York' where and ROWID = 'AAD0ZqAAEAAAAhsAAC';
    it shows "where and", why there is missing after where clause????? --(anyway, I can overcome this by using REGEXP_REPLACE(sql_redo,'where and','where ')
    Thanks
    Roy
    Edited by: ROY123 on Mar 16, 2010 10:25 AM

    I checked logminer documetation:
    http://74.125.93.132/search?q=cache:19bBhYX3Xs4J:download.oracle.com/docs/cd/B19306_01/server.102/b14215/logminer.htm+NOTE:LogMiner+does+not+support+these+datatypes+and+table+storage+attributes:&cd=1&hl=en&ct=clnk&gl=us
    it says 10GR2 support LOB datatype.
    but why "where clause" omit the clob datatype column (becaume "where and rowid")????
    Edited by: ROY123 on Mar 16, 2010 2:12 PM

  • Using CLOB datatypes in WHERE clause

    Hi All,
    I have a table with two columns as CLOB datatype. I'm using Oracle 8i Enterprise Edition. I can do a query, insert, update and even delete the data in the CLOB field using Oracle's SQL Plus.
    What I want is to do a search on those fields.. that is include that field in a WHERE clause. I'm using this datatype to store large number of data.
    I'd like to see this query working...
    SELECT * FROM MyTable WHERE CLOBFLD LIKE 'Something...';
    Now this query doesn't work. It returns: 'Inconsistent datatype' near the word CLOBFLD.
    Please Help me out.
    Regards,
    Gopi
    null

    I presume you want to query based on the contents of the CLOB, right ? If that is true, then you have to create a text index, using Oracle Context and then use "Contains" in the where clause to query. Hope this helps.

  • Problem inserting and querying XML data with a recursive XML schema

    Hello,
    I'm facing a problem with querying XML data that is valid against a recursive XML Schema. I have got a table category that stores data as binary XML using Oracle 11g Rel 2 on Windows XP. The XML Schema is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>I registered this schema and created the category table. Then I inserted a new row using the code below:
    insert into category_a values
    (XMlElement("category",
          xmlattributes('categoryAAA' as "id"),
          xmlforest ('ma categ' as "name"),
          (xmlelement("description", (xmlelement("text", 'find doors blest now whiles favours carriage tailor spacious senses defect threat ope willow please exeunt truest assembly <keyword> staring travels <bold> balthasar parts attach </bold> enshelter two <emph> inconsiderate ways preventions </emph> preventions clasps better affections comes perish </keyword> lucretia permit street full meddle yond general nature whipp <emph> lowness </emph> grievous pedro')))    
    The row is successfully inserted as witnessed by the results of row counting. However, I cannot extract data from the table. First, I tried using SqlPlus* which hangs up and quits after a while. I then tried to use SQL Developer, but haven't got any result. Here follow some examples of queries and their results in SQL Developer:
    Query 1
    select * from category
    Result : the whole row is returned
    Query 2
    select xmlquery('$p/category/description' passing object_value as "p" returning content) from category
    Result: "SYS.XMLTYPE"
    now I tried to fully respect the nested structure of description element in order to extract the text portion of <bold> using this query
    Query 3
    select  xmlquery('$p/category/description/text/keyword/bold/text()' passing object_value as "p" returning content) from  category_a
    Result: null
    and also tried to extract the text portion of element <text> using this query
    Query 4
    select  xmlquery('$p/category/description/text/text()' passing object_value as "p" returning content) from  category_a
    Result: "SYS.XMLTYPE".
    On the other hand, I noticed, from the result of query 1, that the opening tags of elements keyword and bold are encoded as the less than operator "&lt;". This explains why query 3 returns NULL. However, query 4 should display the text content of <text>, which is not the case.
    My questions are about
    1. How to properly insert the XML data while preserving the tags (especially the opening tag).
    2. How to display the data (the text portion of the main Element or of the nested elements).
    The problem about question 1 is that it is quite unfeasible to write a unique insert statement because the structure of <description> is recursive. In other words, if the structure of <description> was not recursive, it would be possible to embed the elements using the xmlelement function during the insertion.
    In fact, I need to insert the content of <description> from a source table (called category_a) into a target table (+category_b+) automatically .
    I filled category_a using the Saxloader utility from an flat XML file that I have generated from a benchmark. The content of <description> is different from one row to another but it is always valid with regards to the XML Schema. The data is properly inserted as witnessed by the "select * from category_a" instruction (500 row inserted). Besides, the opening tags of the nested elements under <description> are preserved (no "&lt;"). Then I wrote a PL/SQL procedure in which a cursor extracts the category id and category name into varchar2 variables and description into an XMLtype variable from category_a. When I try to insert the values into a category_b, I get the follwing error:
    LSX-00213: only 0 occurrences of particle "text", minimum is 1which tells that the <text> element is absent (actually it is present in the source table).
    So, my third question is why are not the tags recognized during the insertion?
    Can anyone help please?

    Hello,
    indded, I was using an old version of Sqlplus* (8.0.60.0.0) because I had a previous installation (oracle 10g XE). Instead, I used the Sqlplus* shipped with the 11g2database (version 11.2.0.1.0). All the queries that I wrote work fine and display the data correctly.
    I also used the XMLSERIALIZE function and can now display the description content in SQL Developer.
    Thank you very much.
    To answer your question Marco, I registered the XML Schema using the following code
    declare
      doc varchar2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>';
    begin
      dbms_xmlschema.registerSchema('/xmldb/category_auction.xsd', doc,     LOCAL      => FALSE, 
            GENTYPES   => FALSE,  GENBEAN    => FALSE,   GENTABLES  => FALSE,
             FORCE      => FALSE,
             OPTIONS    => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
             OWNER      => USER);
    end;then, I created the Category table as follows:
    CREATE TABLE category_a of XMLType XMLTYPE store AS BINARY XML
        XMLSCHEMA "xmldb/category_auction.xsd" ELEMENT "category";Now, there still remains a problem of how to insert the "description" content which I serialized as a CLOB data into another table as XML. To this purpose, I wrote a view over the Category_a table as follows:
    CREATE OR REPLACE FORCE VIEW "AUCTION_XWH"."CATEGORY_V" ("CATEGORY_ID", "CNAME", "DESCRIPTION") AS
      select category_v."CATEGORY_ID",category_v."CNAME",
      XMLSerialize(content ( xmlquery('$p/category/description/*' passing object_value as "p" returning content)) as clob) as "DESCRIPTION"
      from  auction.category_a p, 
    xmltable ('$a/category' passing p.Object_Value as "a"
    columns  category_id varchar2(15) path '@id',
              cname varchar2(20) path 'name') category_v;Then, I wrote a procedure to insert data into the Category_xwh table (the source and target tables are slightly different: the common elements are just copied wereas new elements are created in the target table). The code of the procedure is the following:
    create or replace PROCEDURE I_CATEGORY AS
    v_cname VARCHAR2(30);
    v_description clob ;
    v_category_id VARCHAR2(15);
    cursor mycursor is select category_id, cname, description from category_v;
    BEGIN
    open mycursor;
      loop
      /*retrieving the columns*/
      fetch mycursor into v_category_id, v_cname, v_description ;
      exit when mycursor%notfound;
      insert into category_xwh values
      (XMlElement("category",
          xmlattributes(v_category_id as "category_id"),
          xmlelement("Hierarchies", xmlelement("ObjHierarchy", xmlelement ("H_Cat"),
                                                               xmlelement ("Rollsup",
                                                                                  (xmlelement("all_categories",
                                                                                   xmlattributes('allcategories' as "all_category_id")))
        xmlforest (
                  v_cname as "cat_name",
                  v_description as "description")    
    end loop;
      commit;
      close mycursor;
    END I_CATEGORY;When I execute the procedure, I get the following error:
    LSX-00201: contents of "description" should be elements onlyso, I just wonder if this is because v_description is considered as plain text and not as XML text, even if its content is XML. Do I need to use a special function to cast the CLOB as XML?
    Thanks for your help.
    Doulkifli

  • Can we strore .CSV file into CLOB datatype

    hi
    can we strore .CSV file into CLOB datatype
    its giving me error ot hexa coonversion?
    can anyone provide sample code...
    when i m sending mail from oracle database when i send as blob object then nope but when i send attachment stored in table with clob column it gives me hex to raw conversion error
    folllowing is my code--
    CREATE OR REPLACE PROCEDURE com_maildata_prc1( pi_sender IN com_batch_contact_dtl.strreceivername%TYPE,
    pi_recipients IN com_batch_contact_dtl.stremailaddr%TYPE,
    pi_subject IN VARCHAR2 ,
    pi_text IN VARCHAR2 ,
    pi_filename IN VARCHAR2 ,
    pi_blob IN cLOB
    IS
    conn utl_smtp.connection;
    i NUMBER;
    len NUMBER;
    BEGIN
    ('com_send_email_prc',Vn_Process_Id);
    conn := demo_mail.begin_mail( sender => pi_sender,
    recipients => pi_recipients,
    subject => pi_subject,
    mime_type => demo_mail.MULTIPART_MIME_TYPE
    demo_mail.begin_attachment(conn => conn,
    mime_type => 'application/csv',
    inline => TRUE,
    filename => pi_filename,
    transfer_enc => 'base64'
    -- split the Base64 encoded attachment into multiple lines
    i := 1;
    len := DBMS_LOB.getLength(pi_blob);
    WHILE (i < len) LOOP
    IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
    UTL_SMTP.Write_raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(pi_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
    ELSE
    UTL_SMTP.Write_raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(pi_blob, (len - i)+1, i)));
    END IF;
    UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
    i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
    END LOOP;
    demo_mail.end_attachment(conn => conn);
    demo_mail.attach_text(
    conn => conn,
    data => pi_text,
    mime_type => 'text/csv');
    demo_mail.end_mail( conn => conn );
    END;
    Thanx in advance...
    Message was edited by:
    user549162
    Message was edited by:
    user549162

    Hi
    Ignore "SQL*Loader-292: ROWS parameter ignored when an XML, LOB or VARRAY column is loaded" error
    after importing your csv file just change length CHAR(100000).
    ex: your column col1 CHAR(1000) to change CHAR(100000).
    and deploy your mapping and execute
    Regards,
    Venkat

  • How to query a CLOB column

    Hello All,
    I am trying to query a CLOB column with some text string. Can anyone tell me how to do this. Here is a simple example of my code and the error message I get....
    SQL> select title_column from atlas_table where clob_column like '%a%';
    select title_column from atlas_table where clob_column like '%e%'
    ERROR at line 1:
    ORA-00932: inconsistent datatypes
    Thanks,
    Danny

    Selecting a LOB from a table actually returns the LOB's locator and not the entire LOB value..
    and you should have a frontend to retrieve the clob or blob..
    if u have you can view/update/..do DML operations on the column
    null

  • Grouping clause failing for CLOB Datatype

    Hi,
    I am facing error while Selecting the following expression:
    ORA-00932: inconsistent datatypes: expected - got CLOB
    OBJECT_CONTENT is a CLOB Datatype
    SELECT
    MAX(A.VERSION_ID)
    OBJECT_CONTENT
    FROM
    VERSION_HISTORY A,
    OBJECT_MASTER B
    WHERE
    A.BUOBJECT_ID=B.BUOBJECT_ID
    GROUP BY OBJECT_CONTENT
    Any help will be needful for rme

    So, what's your question? You can use CLOB in the GROUP BY ....
    quote from doc:
    Restrictions on the GROUP BY Clause:
    This clause is subject to the following restrictions:
    You cannot specify LOB columns, nested tables, or varrays as part of expr.
    The expressions can be of any form except scalar subquery expressions.
    If the group_by_clause references any object type columns, then the query will not be parallelized.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#SQLRF01702
    Edited by: Alex Nuijten on Aug 11, 2009 9:02 AM

  • What control i can use for Clob datatype in forms?

    Hi,
    Backend side
    I had created a table that having a column namely sql_text which hold the query string and defined as CLOB data type.
    On Form 6i
    Just i created a textitem(long) for the clob datatype field
    but it only hold very limited length of charter, i want to be more. Any other control is there?
    please guid me what should i want to do.
    kanish

    There is limited support for CLOBs in Forms. I guess you could read it in piecemeal with a procedure using the DBMS_LOB package

  • Clob DataType, NULL and ADO

    Hello,
    First, I'm french so my english isn't very good
    I have a problem with Oracle Clob DataType. When I try to put NULL value to
    CLOB DataType with ADO, changes aren't not made.
    rs.open "SELECT ....", adocn, adOpenKeyset, adLockOptimistic
    rs.Fields("ClobField") = Null ' In this case, the Update doesn't work
    rs.update
    rs.Close
    This code works if I try to write a value which is different than Null but
    not if is equal to Null. Instead of having Null, I have the old value
    (before changes), the update of the field doesn't work.

    I experience the same, did you find a solution to your problem?
    Kind regards,
    Roel de Bruyn

  • Error in CLOB datatype for transfering data from Excel to Oracle database

    Am using excel sheet as source and Oracle as target Database.
    For all tables the operations works smoothly except for tables containing CLOB datatype.
    Initially i have used SQL Developer to transfer some data into excell sheets, now i want to transfer those file's data into another Oracle Database.
    What other options do i have?
    Is excel not the right tool to transfer CLOB datatypes?

    well,
    I couldn't suggest an excel to do it...
    You can go from Oracle to Oracle with the PL/SQL IKM. It works fine.
    Does it help you?

Maybe you are looking for