Conversion/extraction of CLOB
Hello.We are able to insert CLOB in the database, using oracle Text I'm able to search inside clob.
[two issues resolved]
The question arises when we need to send these data to demand either as text (varchar2) file.
I'm able to generate files of CLOB using the function, unfortunately it is located inside the db and developer is not able to access.
1) there is a possibility to mount the partition of application inside the db and export the file there, but this isn't a viable option according to the direction.
(2) I google the solution to create a JAVA API. Who will perform the command OS like scp to send file to db to app (or any remote host).
For security reasons, this option is also removed.
(3) I tried dbms_lob.substr but text inside clob is too long. File generated from CLOB size about 5 MB.
So I guess it takes a lot of effort if I wanted to convert in varchar2 as parameter inside the exit function.
So, to give CLOB data developer under file or varchar2. I'm not able to get any solution.
Y at - it another option using database to convert to string/varchar2 CLOB?
Or do I need to dig more into the third option.
I have oracle 10.2.0.5.
Kind regards
Dave.
application developer to manage the clob issue.
Tags: Database
Similar Questions
-
conversion of a clob entry in a collection
Hi I have a function that has a CLOB to entry. The input value is concatenated to multiple values. I need to separate and process the data. Here is an example of sample function. Can someone help me on this please. I'm not able to get any solution.
l_orders CLOB Chennai | $| Mumbai | $| Delhi | $| Amsterdam | $| Brazil | $| ......... | $| Hyderabad
Now I need to enter the values as below in a collection
l_orders (1) chennai
l_orders (2) Mumbai
l_orders (3) Delhi
Amsterdam l_orders (4)
l_orders (5) Brazil
.
.
.
.
l_orders (6000) Hyderabad
These values, I need to spend in the table and make a DML operation under certain conditions. I'm helpless on how to extract the CLOB entry in a collection.
I use version oracle 11g.
It looks to...
Another look: the CLOB is transformed in a way that allows for handlng as an xmltype.
Your particular case, it's that you are having just a single column (your | $| is Chr (10) in the solution) and you should get a result set single column to be processed according to your needs (you might be more comfortable to add a line number using keyword ordinalite to maintain order CLOB)
Concerning
Etbin
If you are having trouble:
with
data in the form of
(select to_clob ('Chennai | $|)) Mumbai | $| Delhi | $| Amsterdam | $| Brazil | $| Hyderabad') the_clob
of the double
)
Select rn, col1
data,.
XMLTable ('/ a/b ')
from xmltype ('': replace (the_clob, ' | ')) $| ','')||'')
columns
RN to ordinalite,
col1 varchar2 (100) path '.'
) x
RN COL1 1 Chennai 2 Mumbai 3 Delhi 4 Amsterdam 5 Brazil 6 Hyderabad -
Help to extract data Clob to a column in a table that has several lines in a table
Help to extract data Clob to a column in a table that has several lines in a table
It works for only the first line
CREATE or REPLACE DIRECTORY XMLDIR AS ' / orabackups';
Grant read, write on DIRECTORY XMLDIR to the public;
() dbms_xslprocessor.clob2file
beef in CLOB,
XMLDIR IN VARCHAR2,
"testfile2.txt" IN VARCHAR2);
DECLARE
buf CLOB.
BEGIN
SELECT H15_DOC
IN buf
OF H15TEST. H15_STAGE
where rownum = 1;
dbms_xslprocessor.clob2file (buf, 'XMLDIR', 'testfile2.txt');
END;
/
-This error code
CREATE or REPLACE DIRECTORY XMLDIR AS ' / orabackups';
Grant read, write on DIRECTORY XMLDIR to the public;
() dbms_xslprocessor.clob2file
XData in CLOB,
XMLDIR IN VARCHAR2,
"testfile2.txt" IN VARCHAR2,
CSID in NUMBER: = 0);
DECLARE
CURSOR xmlmycur IS SELECT H15_DOC
OF H15TEST. H15_STAGE
where rownum = 102140;
l_clob CLOB.
XData CLOB.
BEGIN
DBMS_LOB.CREATETEMPORARY (l_clob, true);
DBMS_LOB.CREATETEMPORARY (xdata, true);
OPEN xmlmycur.
LOOP
SEEK xmlmycur INTO xdata;
dbms_xslprocessor.clob2file (xdata, 'XMLDIR', 'testfile2.txt');
EXIT WHEN xmlmycur % notfound;
END LOOP;
CLOSE Xmlmycur;
END;
/
ORA-21560: 3 argument is null, invalid or out of range
ORA-06512: at "SYS." DBMS_LOB", line 991
ORA-06512: at "XDB". DBMS_XSLPROCESSOR', line 324
ORA-06512: at line 15 level
FYI, it seems that the file being created will exceed 5 gig
Yes, it is a known issue with DBMS_XSLPROCESSOR.clob2file with big files.
Here is a slightly modified version of the code that I posted earlier, fixing WRITE_ERROR except:
DECLARE
v_file utl_file.file_type;
-write a unique to clob
procedure write_clob (p_content in clob) is
v_buffer varchar2 (32767).
V_POSITION pls_integer: = 1;
v_amount pls_integer: = 32767;
Start
loop
Start
DBMS_LOB. Read (p_content, v_amount, v_position, v_buffer);
exception
When no_data_found then exit;
end;
UTL_FILE.put_raw (v_file, utl_raw.cast_to_raw (v_buffer), true);
V_POSITION: = v_position + v_amount;
end loop;
end;
BEGIN
-Open the file
v_file: = utl_file.fopen ('TEST_DIR', 'testfile2.txt', 'wb', 32767);
-loops through the lines
for r in)
Select h15_doc
of h15test.h15_stage
)
loop
write_clob (r.h15_doc);
end loop;
UTL_FILE.fclose (v_file);
END;
/
-
Passing data from attachment of DB (Blob data Type) after the CLOB data type conversion, giving the error "ORA-06502: PL/SQL: digital error or value" in the PL/SQL package. If the BLOB size 32K > it will give another error works great my procedure.
For example, I enclose my code here.
function get_base64 (p_blob_in in blob) return clob is
CLOB v_clob;
CLOB v_result;
whole v_offset;
v_chunk_size PLS_INTEGER: = 12288;
v_buffer_varchar varchar2 (32767).
v_buffer_raw raw (32767).
Start
fnd_file.put_line (fnd_file.log, 'here');
If p_blob_in is null then
Returns a null value.
end if;
DBMS_LOB.CREATETEMPORARY (v_clob, true);
fnd_file.put_line (fnd_file.log, 'here1');
v_offset: = 1;
fnd_file.put_line (fnd_file.log, 'Loop value'-| ceil (DBMS_LOB.) GetLength (p_blob_in) / v_chunk_size));
because me in 1... ceil (DBMS_LOB. GetLength (p_blob_in) / v_chunk_size) loop
DBMS_LOB. Read (p_blob_in, v_chunk_size, v_offset, v_buffer_raw);
v_buffer_raw: = utl_encode.base64_encode (v_buffer_raw);
v_buffer_varchar: = utl_raw.cast_to_varchar2 (v_buffer_raw);
DBMS_LOB. WriteAppend (v_clob, length (v_buffer_varchar), v_buffer_varchar);
v_offset: = v_offset + v_chunk_size;
end loop;
fnd_file.put_line (fnd_file.log, 'Out of the loop');
v_result: = v_clob;
fnd_file.put_line (fnd_file.log, 'V_result length' - |) DBMS_LOB. GetLength (v_result));
fnd_file.put_line (fnd_file.log, 'V_result' - | v_result);
DBMS_LOB.freeTemporary (v_clob);
Return v_result;
exception
while others then
fnd_file.put_line (fnd_file.log, 'Error based on the encode_base64' - |) SQLERRM);
Returns a null value.
end;
In my main program I call this function as below:
Main proceedings...
l_return_clob CLOB.
Begin
....
l_return_clob: = get_base64 (p_blob_in);
-In returning it gives error - ORA-06502: PL/SQL: digital error or value
end;
Then, please mark the thread ANSWERED.
-
Hello!
I need to extract a data defined as string with 5,000 jobs. In the relational table, I created a CLOB column. How can I do this extraction?
I tried this:
And received the error:WITH test AS (SELECT XMLTYPE('<node1> <node2> <text1>text 1</text1> <longtext>long text</longtext> </node2> </node1>') data_col FROM dual) SELECT text1, longtext FROM test t, XMLTable('/node1/node2' PASSING t.data_col COLUMNS text1 VARCHAR2(2000) PATH 'text1', longtext CLOB PATH 'longtext')
Thanks for any help!ORA-00932: inconsistent datatypes: expected - got CLOB
Well, support CLOB in XMLTable works for sure on version 10.2.0.4 and upward.
You can try one of these?
WITH test AS (SELECT XMLTYPE('
text 1 long text WITH test AS (SELECT XMLTYPE('
text 1 long text -
Digital or value error on the conversion of the clob to SMLType
Hello
What I'm trying to do is
(i.) pass a value of xml string to the Oracle query variable
II.) use this XML as part of a join in a query and retrieve the results.
Approach:
Input variable type is CLOB and then running the petition below:
declare
TestXML clob.
Start
textxml: = ' < table1 > < root > < none > 1 < /no > < / root > < root > < none > 2 < / > < non-root / > < / table1 > '
Open: csr for
Select tt.no
de)
Select xmltype.extract (value (a), ' root/no/text()').getstringval () than no.)
table (xmlsequence (sys.xmltype(:testxml). Extract('/table1/root'))) a
) tt
Tt.no group;
end;
Problem:
The request as written above wake up a digital error or value to sys.xmltype (ORA-06502 & ORA-06512). But if I declare the testxml as varchar2; It works very well. Searched wrong, but without success.
Ideas please!
Other info: Oracle 10g, tool: PL/SQL Developer (Allround Automations).
3 days on Oracle; on SQL Server 7 years... :) {so be a bit elaborate}
Spacing of code does not work :( How do we code tags in this forum?
Published by: rajeev.ranjan on May 11, 2009 07:43XMLTABLE usage example:
SQL> ed Wrote file afiedt.buf 1 create or replace procedure get_nos(p_rc OUT sys_refcursor) is 2 testxml clob; 3 begin 4 testxml := '
'; 5 open p_rc for 6 select tt.no 7 from ( 8 select no 9 from xmltable('/table1/root/no' passing xmltype(testxml) columns no number path '/no/text()') 10 ) tt 11 group by tt.no; 12* end; SQL> / Procedure created. SQL> var rc refcursor SQL> exec get_nos(:rc); PL/SQL procedure successfully completed. SQL> print rc; NO ---------- 1 2 SQL>1 2 -
Easily accessible images AVI - BMP Conversion extraction
Hi, Im at a roadblock now, I have to extract frames of an AVI video then convert BMP images and load/apply a texture to an object in a 3D scene. Now the problem is not extract frames, Ive managed to extract the images using the available screws of AVI IMAQ but Im stuck after that.
I found the 'writing BMP file' VI under the utilities of Vision, one of the terminals of the VI says 'File path' which means the way he's going to write the file is now? Or...?
Secondly, I can't find a way to load/save lots of BMPS at the same time. The texture that I apply to the object comes to a BMP image (and in this case, a lot of BMP images extracted from AVI video) just by using the "Read file BMP" vi, which leads to the directory/path of the BMP on the PC. This is where the problem lies, I need the vi 'Read BMP file' was updated constantly, every 'x' seconds to account for the number of frames / FPS of the video then she reads each frame of the video as its update. But if I need to save the accquired executives AVI MPG I don't see a way to do this.
Any suggestions would be greatly appreciated.Hi again
I hope that your application is on the right track now. I found other examples for the avi feature, so I'll add the links below.
http://decibel.NI.com/content/docs/doc-12618
http://decibel.NI.com/content/docs/doc-8479
http://decibel.NI.com/content/docs/doc-4672
If you have any other questions do not hesitate to ask
Thank you
Steph
-
Hello
I wonder how to deal with a clob field in a JSON object that is returned by a web service. It consists of 3 - number, varchar2, and clob fields and looks like this:
{"MyNumber": 10}
'MyVarchar2': ' application/pdf ',.
{'MyClob': 'JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9GaWx0ZXI'}
Its very easy to take the first two values using built-in functions, but I have no idea how to do to extract the clob value. My code is as follows:
DECLARE
v_response_clob CLOB; - the entire web service responsev_my_number NUMBER;
v_my_varchar2 VARCHAR2 (100);
v_my_clob CLOB.
BEGIN
-Select clob from collections of apex
SELECT c.clob001
IN v_response_clob
Of apex_collections c
WHERE c.collection_name =: PX_MY_COLLECTION_NAME;
-parse response clob
apex_json. Parse (v_response_clob);
-get my number
v_my_number: = apex_json.get_number (p_path = > "MyNumber");
-My varchar2
v_my_varchar2: = apex_json.get_varchar2 (p_path = > 'MyVarchar2');
-now how to get the CLOB?END;
Any help would be much appreciated.
Thank you very much
Pavel
Edit: I forgot to mention that I use 11g XE, so the new JSON 12 c functions are not available and 5 APEX (which is actually quite obvious because of the APEX_JSON package).
Hahaha,
This is a known issue (well documented):
20974582 - apex_json.parse errors when parsing CLOB if DB Version<>
If your version of the database is 11.1.x, 11.2.0.1, 11.2.0.2 or 11gXE, apex_json.parse may report errors during parsing of a clob.
Solution: There is a group exception of fixes for this available on My Oracle Support - search by 20931298bug number. If you use ADR (Apex Listener), restart after installation of the patch.
Workaround: If you have not installed the patch, you can use the overloaded analytical procedures that take varchar2 or table of varchar2 rather.
Here
Martin Giffy Souza on Oracle APEX: APEX_JSON. ANALYZE the issue with CLOB and 11g
is a nice article on this subject.
-
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:54I 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
-
Hi all
I am creating an interface ODI as explained below,
I table A column 'Comments' and one other table with column B "No Comment." I create a view as shown below and use it as a source for my interface.
SELECT * FROM WC_EQM_CSAP_FS_TMP WHERE to_char (QUESTION_COMMENT) IN (SELECT NO_COMMENTS FROM WC_EQM_NO_COMMENTS_LIST).
But my interface fails with the error below
ORA-22835: buffer too small for to CHAR CLOB or BLOB to RAW conversion (real: 4108, maximum: 4000)
22835 00000 - "too small buffer tank CLOB or BLOB to RAW conversion (actual: %s, maximum: %s)) '
* Cause: an attempt was made to convert CLOB to CHAR or BLOB to RAW, where
LOB size was larger than the buffer for CHAR and RAW limit types.
Note that the widths are reported in characters if characters length isadds are in effect for the column, other widths are
in bytes.
Here QUESTION_COMMENT is of type CLOB data. NO_COMMENTS is also CLOB data type. The maximum length of the data of QUESTION_COMMENT is also 11710
Please tell us how to solve.
Thank you
Dany
IMHO, it is not good to compare CLOB, can be that it is possible to use the primary key for the comments
Is it QUESTION_COMMENT and NO_COMMENTS a PRIMARY INDEX,
may be is the best solution to create vacabulary with comments (if it does not exist) and then compare it by id;
You can simply use the left join and check for null in a CASE statement
Try this, but I don't know... as I said before I have no Oracle DB
SELECT INTEGRATION_ID, DATASOURCE_NUM_ID, QUESTIONNAIRE_ID, QUESTION_ID,
CLIENT_ID, SITE_ID, CLIENT_REP, COMMITMENT, ENGAGEMENT_TYPE, TOP_CLIENT_FLG,
INITIAL_PLANNED_DT, REVISED_PLANNED_DT, INTERVIEW_DT, RECEIVED_DT, QUESTION_SCORE,
(
CASE WHEN EXISTS (SOME T2.NO_COMMENTS OF WC_EQM_NO_COMMENTS_LIST T2 WHERE DBMS_LOB.COMPARE (TMP.) (QUESTION_COMMENT, T2.NO_COMMENTS) = 0)
THEN NULL
OF OTHER QUESTION_COMMENT
END QUESTION_COMMENT),
(CASE WHEN QUESTION_SCORE<=5 then="" 1="" else="" 0="" end)="">=5>
0 AS QWOCOMMENTS,
CREATED_ON_DT, CHANGED_ON_DT OF WC_EQM_CSAP_FS_TMP as TMP
P.S. does not use TO_CHAR (LOB) there are possible error
-
How to extract a value of sql xml column clob data
Hi guys,.
I need help with the following. I have a column with data type xml (clob data). I need to extract the information in the < RI4 > tag and the < RI6 > tag.
I truncated the data, but there is a repetition of the < RI4 > tag and consequenty internal to that tag RI6. However, each tag RI4 and RI6 has different data.I would be grateful if you can help me with this:
<a xsi:schemaLocation="som location.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:somlocation"> <b>Some stuff here</b> <c> <someinfo>blah</someinfo> <someinfo2>blah2</someinfo2> </c> <EffectiveDateTime>2015-10-01T00:00:00+10:00</EffectiveDateTime> <CurrencyCode>AUD</CurrencyCode> <RequiredInformation> <RequiredInformation2> <RequiredInformation3> <RI4>someinfo</RI4> <RI5> <RI6> <a1>1</a1> <b1>9.13</b1> </RI6> <RI6> <a1>2</a1> <b1>8.75</b1> </RI6> <RI6> <a1>3</a1> <b1>78.90</b1> </RI6> <RI6> <a1>4</a1> <b1>200</b1> </RI6> <RI6> <a1>5</a1> <b1>17.59</b1> </RI6> </RI5> </RequiredInformation3> </RequiredInformation2> </RequiredInformation> </a>
I think that since it's the repetition I might need to make some sort of PL/SQL programming, but I really need help here to build this announcement also a way to extract the information.
Any help would be greatly appreciated.
Kind regards
You can parse your XML like this
SQL> with t 2 as 3 ( 4 select 5 ' 6 Some stuff here 7
8 11blah 9blah2 102015-10-01T00:00:00+10:00 12AUD 1314 42 ' xml_str 43 from dual 44 ) 45 select t1.ri4, t2.a1, t2.b1 46 from t 47 , xmltable 48 ( 49 xmlnamespaces(default 'urn:somlocation', 'http://www.w3.org/2001/XMLSchema-instance' as "xsi") 50 , '/a/RequiredInformation/RequiredInformation2/RequiredInformation3' passing xmltype(t.xml_str) 51 columns 52 ri4 varchar2(10) path 'RI4' 53 , ri5 xmltype path 'RI5' 54 ) t1 55 , xmltable 56 ( 57 xmlnamespaces(default 'urn:somlocation') 58 , '/RI5/RI6' passing t1.ri5 59 columns 60 a1 number path 'a1' 61 , b1 number path 'b1' 62 ) t2; RI4 A1 B1 ---------- ---------- ---------- someinfo 1 9.13 someinfo 2 8.75 someinfo 3 78.9 someinfo 4 200 someinfo 5 17.59 SQL>15 4116 40someinfo 1718 3919 221 209.13 2123 262 248.75 2527 303 2878.90 2931 344 32200 3335 385 3617.59 37 -
extraction of data from a clob column
I need help, extraction of a string in a clob in a table column. the string is separated by commas (IE 5555,6666,777777,999999). what I need is to retrieve only numbers that have been sepatated by the comma.
Try this...
SELECT REGEXP_SUBSTR (clob_val, "[^,] +', 1, LEVEL") sep_val
Of
CONNECT BY LEVEL<= length(regexp_replace(clob_val,="" '[^,]+'))="">=>
Unit tests: -.
SELECT REGEXP_SUBSTR (clob_val, "[^,] +', 1, LEVEL") sep_val
Of
(SELECT TO_CLOB ('5555,6666,777777,999999') clob_val
THE DOUBLE)
CONNECT BY LEVEL<= length(regexp_replace(clob_val,="" '[^,]+'))="">=>
OUTPUT:-
-------
SEP_VAL
-------
5555
6666
777777
999999
-
PDF to Word conversion and extract pages
I bought the program of conversion of PDF to Word, but is not copy graphs. All I have to do is extract pages of a large file to separate them. I have that drive. Nothing, I see works online.
Hi theresadrj,
Subscribe only for services to export in PDF format, which is used to convert PDF files to supported file formats.
In order to use the pages of the excerpt from a PDF file you need Acrobat application (Adobe Acrobat free trial downloadversion |) Acrobat Pro DC), check this tutorial document split split a PDF | Adobe Acrobat DC tutorials.
Kind regards
Nicos
-
CLOB DataType: conversion with loss when migrating to WE8ISO8859P1 to AL32UTF8
We have an application data in a database of output 9.2.0.8 (characterset WE8ISO8859P1).Now, the data must be migrated in a 11.2.0.3 output database (characterset AL32UTF8).
When you run the CSSCAN utility on the target (9.2.0.8) database I get the following result:
Table: MASTERCONTENT
Column: INFO
Type: CLOB
Number of Exceptions: 116
Size of data Conversion MAX Post: 1489532ROWID Exception Type size cell Data (first 30 bytes)
------------------ ------------------ ----- ------------------------------
AAA4jBAAKAAACRcAAA conversion with loss
AAA4jBAAKAAACRcAAB conversion with loss
AAA4jBAAKAAAvNqAAA conversion with loss
AAA4jBAAKAABg0nAAC conversion with loss
AAA4jBAAKAABg0nAAE conversion with loss...
From my understanding CLOB objects can store up to (4 gigabytes-1) * (the value of the LOB CHUNK storage parameter)
data of type character. Or is the problem that can not get the characters of certain lines converted AL32UTF8?
Currently, I do not understand why "lossy conversion" will happen...
Any help will be appreciated!
Rgds
Jan
"Lossy conversion" means that some codes of characters (bytes) the CLOB listed are not recognized as valid in WE8ISO8859P1. These codes are usually in the range 0 x 80-0x9f. You must take a look at these codes and try to guess what is their true meaning. In most cases that meet Oracle customers, these illegal WE8ISO8859P1 are actually codes of WE8MSWIN1252 (WE8MSWIN1252 is a binary superset of WE8ISO8859P1). The solution is then to set the source game the good character of characters in database value and then export.
Thank you
Sergiusz
-
extracting data from the CLOB using materialized views
Hello
We have xml data from clob which I have a requirement to extract (~ 50 attributes) on a daily basis, so we decided to use materialized views with refreshes full (open good suggestions)
A small snippet of code
CREATE THE MWMRPT MATERIALIZED VIEW. TASK_INBOUND
IMMEDIATE CONSTRUCTION
FULL REFRESH ON DEMAND
WITH ROWID
AS
SELECT M.TASK_ID, M.BO_STATUS_CD, b.*
OF CISADM. M1_TASK m,
XMLTABLE (' / a ' XMLPARSE PASSING ())
CONTENT '< a > | M.BO_DATA_AREA | "< /a >."
) COLUMNS
serviceDeliverySiteId varchar2 (15) PATH
"cmPCGeneralInfo/serviceDeliverySiteId"
serviceSequenceId varchar2 (3) PATH "cmPCGeneralInfo/serviceSequenceId"
completedByAssignmentId varchar2 (50) PATH "completedByAssignmentId."
Cust_id varchar2 (10) PATH "cmPCCustomerInformation/customerId,"
ACCT_SEQ varchar2 (5) PATH "customerInformation/accountId"
AGRMT_SEQ varchar2 (5) PATH cmPCCustomerAgreement/agreementId"."
COLL_SEQ varchar2 (5) PATH "cmPCGeneralInfo/accountCollectionSeq"
REVENUE_CLASS varchar2 (10) PATH "cmPCCustomerAgreement/revenueClassCode"
REQUESTED_BY varchar2 (50) PATH ' attributes customerInformation/contactName',...~50
This ddl ran > 20 hours and no materialized view created. There are certain limits that we have
- Cannot create a materialized view log
- cannot change the source as its defined provider table
- cannot do an ETL
DB is 11g R2
Any ideas/suggestions are very much appreciated
I explored a similar approach, using the following test case.
It creates a table "MASTER_TABLE" containing 20,000 lines and a CLOB containing an XML fragment like this:
09HOLVUF3T6VX5QUN8UBV9BRW3FHRB9JFO4TSV79R6J87QWVGN UUL47WDW6C63YIIBOP1X4FEEJ2Z7NCR9BDFHGSLA5YZ5SAH8Y8 O1BU1EXLBU945HQLLFB3LUO03XPWMHBN8Y7SO8YRCQXRSWKKL4 ...
1HT88050QIGOPGUHGS9RKK54YP7W6OOI6NXVM107GM47R5LUNC 9FJ1JZ615EOUIX6EKBIVOWFDYCPQZM2HBQQ8HDP3ABVJ5N1OJA then an intermediate table "MASTER_TABLE_XML" with the same columns with the exception of the CLOB which turns into XMLType and finally a MVIEW:
SQL > create table master_table like
2. Select level as id
3, cast ('ROW' | to_char (Level) as varchar2 (30)) as the name
4 , (
5. Select xmlserialize (content
XMLAGG 6)
7 xmlelement (evalname ('ThisIsElement' | to_char (Level)), dbms_random.string ('X', 50))
8 )
9 as clob dash
10 )
11 double
12 connect by level<=>=>
(13) as xmlcontent
14 double
15 connect by level<= 20000="">=>
Table created.
SQL > call dbms_stats.gather_table_stats (user, 'MASTER_TABLE');
Calls made.
SQL > create table (master_table_xml)
Identification number 2
3, name varchar2 (30)
4, xmlcontent xmltype
5)
binary xmltype 6 securefile XML column xmlcontent store
7;
Table created.
SQL > create materialized view master_table_mv
2 build postponed
full 3 Refresh on demand
4, as
5. Select t.id
6, t.nom
7 , x.*
master_table_xml 8 t
9, xmltable ('/ r' in passing t.xmlcontent)
10 columns
11 path of varchar2 (50) ThisIsElement1 'ThisIsElement1 '.
12, path of varchar2 (50) ThisIsElement2 'ThisIsElement2 '.
13, path of varchar2 (50) ThisIsElement3 'ThisIsElement3 '.
14, path of varchar2 (50) ThisIsElement4 'ThisIsElement4 '.
15 road of varchar2 (50) ThisIsElement5 'ThisIsElement5 '.
16, road of varchar2 (50) ThisIsElement6 'ThisIsElement6 '.
17 road of varchar2 (50) ThisIsElement7 'ThisIsElement7 '.
18 road of varchar2 (50) ThisIsElement8 'ThisIsElement8 '.
19 road to varchar2 (50) ThisIsElement9 'ThisIsElement9 '.
20, path of varchar2 (50) ThisIsElement10 'ThisIsElement10 '.
21, road to varchar2 (50) ThisIsElement11 'ThisIsElement11 '.
22 road of varchar2 (50) ThisIsElement12 'ThisIsElement12 '.
23 road of varchar2 (50) ThisIsElement13 'ThisIsElement13 '.
24, path of varchar2 (50) ThisIsElement14 'ThisIsElement14 '.
25 road of varchar2 (50) ThisIsElement15 'ThisIsElement15 '.
26, path of varchar2 (50) ThisIsElement16 'ThisIsElement16 '.
27, way to varchar2 (50) ThisIsElement17 'ThisIsElement17 '.
28 road of varchar2 (50) ThisIsElement18 'ThisIsElement18 '.
29 road of varchar2 (50) ThisIsElement19 'ThisIsElement19 '.
30, path of varchar2 (50) ThisIsElement20 'ThisIsElement20 '.
31, path of varchar2 (50) ThisIsElement21 'ThisIsElement21 '.
32 road of varchar2 (50) ThisIsElement22 'ThisIsElement22 '.
33, path of varchar2 (50) ThisIsElement23 'ThisIsElement23 '.
34 road of varchar2 (50) ThisIsElement24 'ThisIsElement24 '.
35 road of varchar2 (50) ThisIsElement25 'ThisIsElement25 '.
36, road to varchar2 (50) ThisIsElement26 'ThisIsElement26 '.
37, path of varchar2 (50) ThisIsElement27 'ThisIsElement27 '.
38, path of varchar2 (50) ThisIsElement28 'ThisIsElement28 '.
39, path of varchar2 (50) ThisIsElement29 'ThisIsElement29 '.
40, road of varchar2 (50) ThisIsElement30 'ThisIsElement30 '.
41 road of varchar2 (50) ThisIsElement31 'ThisIsElement31 '.
42, path of varchar2 (50) ThisIsElement32 'ThisIsElement32 '.
43, road to varchar2 (50) ThisIsElement33 'ThisIsElement33 '.
44, path of varchar2 (50) ThisIsElement34 'ThisIsElement34 '.
45, path of varchar2 (50) ThisIsElement35 'ThisIsElement35 '.
46, path of varchar2 (50) ThisIsElement36 'ThisIsElement36 '.
47, path of varchar2 (50) ThisIsElement37 'ThisIsElement37 '.
48, path of varchar2 (50) ThisIsElement38 'ThisIsElement38 '.
49, path of varchar2 (50) ThisIsElement39 'ThisIsElement39 '.
50 road of varchar2 (50) ThisIsElement40 'ThisIsElement40 '.
51, path of varchar2 (50) ThisIsElement41 'ThisIsElement41 '.
52, path of varchar2 (50) ThisIsElement42 'ThisIsElement42 '.
53, path of varchar2 (50) ThisIsElement43 'ThisIsElement43 '.
54, path of varchar2 (50) ThisIsElement44 'ThisIsElement44 '.
55 road of varchar2 (50) ThisIsElement45 'ThisIsElement45 '.
56, path of varchar2 (50) ThisIsElement46 'ThisIsElement46 '.
57, path of varchar2 (50) ThisIsElement47 'ThisIsElement47 '.
58 road of varchar2 (50) ThisIsElement48 'ThisIsElement48 '.
59 road of varchar2 (50) ThisIsElement49 'ThisIsElement49 '.
60 road of varchar2 (50) ThisIsElement50 'ThisIsElement50 '.
(61) x;
Materialized view created.
The discount is then performed in two steps:
- INSERT INTO master_table_xml
- Refresh the MVIEW
(Note: as we insert in an XMLType column, we need an XML (only root) document this time)
SQL > set timing on
SQL >
SQL > truncate table master_table_xml;
Table truncated.
Elapsed time: 00:00:00.27
SQL >
SQL > insert into master_table_xml
2. select id
3, name
4, xmlparse (document '
' |) XmlContent |' ')5 master_table;
20000 rows created.
Elapsed time: 00:04:38.72
SQL >
SQL > call dbms_mview.refresh ('MASTER_TABLE_MV');
Calls made.
Elapsed time: 00:00:22.42
SQL >
SQL > select count (*) in the master_table_mv;
COUNT (*)
----------
20000
Elapsed time: 00:00:01.38
SQL > truncate table master_table_xml;
Table truncated.
Elapsed time: 00:00:00.41
Maybe you are looking for
-
First boot of Windows after Windows-10 updated
Hey, if I run Windows 10 on my MacBook Pro via Boot Camp 2015 retina. A few days ago I installed upgrading big anniversary for Windows 10. Since then, whenever I start my MBP, it always tries to start on Windows first for some reason any. I always ha
-
How to remove applications or programs to the macbook pro
How to delete apps or programs of macbook pro! Uninstalling microsoft worldwide feature is used. I was told just drag to the trash can, it works sometimes, but not always!
-
Accidentally messed up partitions
Hey everybody. Then... I messed up. I wanted to delete my Bootcamp partition, but I forgot that I need to do with the Bootcamp Assistant, and as this guy , I tried to do it with disk utility instead. Now, I'm just an empty Bootcamp partition that I c
-
Acer laptop: the desktop icons used open in Windows 10
The desktop icons will not open in Windows 10. I get the menu drop-down-directed by the word 'View', but the word 'Open' is nowhere in it! Please, please, help. Thank you.
-
How to make a routine traffic stop and start again without restarting labview?
I am under Labview 6i and kinda a noob. I have a Subvi designed to take information and write it to a file, but whenever I stop this Subvi it will not start again until I restart the entire VI. I wish I could start it and stop it, and take multiple