How to write the xml content of a file (Blob data Type) with other columns in file system
Team,
We are currently working on oracle 11 g. Suppose that we consider the SCOTT. EMP table for our creation of the table.
All existing columns of SCOTT along. EMP table allows to assume that this table has an additional column name emp_xml, which is of TYpe of BLOB data and it holds xml data.
the size of the data blob for each record in this col is greater than 32 KB (normally about 1 GB), now I want to write the contents of this column along
with enmae, empno, hiredate into an external file. Assume that if we are only to the BLOB column that is emp_xml then the code below works
Start
for c in (select emp_xml from your_table)
loop
dbms_xslprocessor.clob2file (emp_xml.getclobval (), 'YOUR_LOCATION', 'YOUR_DYNAMIC_FILENAME')
end loop;
end;
but I want empno, enmae, hiredate with blob emp_xml written in the external file. Any assistance in this case welcome.
Concerning
|
Maximum number of characters for each line, including the newline character, |
Defines how much you can read or write to a single call. I have to loop through the clob object and I write a pieces of 1024. So there is no limit to how much she can write. Just test it, IT will WORK!
Tags: Database
Similar Questions
-
How to write the xml data to a file in pl/sql
Hello
DB version: 11.2.0.2.0
Apps Version: 12.1.3
We try to generate an xml file in a directory on the server through pl/sql program. Here is the code we use. But it gives an error like ' failed due to the ORA-01422: exact fetch returns more than number of lines. When we put the select statement in a cursor and try to write data one by one in the loop, it is written only one record. Please tell us if we make a mistake.
-The code in error
CREATE or REPLACE PROCEDURE TEST_XML_CREATE (errbuf OUT VARCHAR2
ERRCODE OUT NUMBER)
IS
l_file_name VARCHAR2 (30);
l_file_path VARCHAR2 (200);
l_xmldoc CLOB.
BEGIN
l_file_path: = 'FTPPOST_OUT_GTI_AUDIT ';
l_file_name: = 'TEST_XREF4.xml ';
SELECT
XMLElement ("financialorganization:LegalEntityList",
xmlattributes ('http://schema.bppost1.be/entities/financial/financialorganization/v001' "xmlns:financialorganization", )
' http://schema.bppost1.be/entities/base/BaseTypes/V001 ' 'xmlns:basetype',
' http://www.w3.org/2001/XMLSchema-instance ' "xmlns: xsi"),
XmlElement ("financialorganization:LegalEntity",
XmlElement ("financialorganization:LegalEntityCode", fv.flex_value)
XmlElement ("financialorganization:Description", fv.description)
XmlElement ("basetype:ValidityPeriod",
XmlElement ("basetype:OpenEndedPeriod",
XmlElement ("basetype:StartDate", TO_CHAR(start_date_active,'YYYY-MM-DD')),
XmlElement ("basetype:EndDate", TO_CHAR (end_date_active, 'YYYY-MM-DD'))
)
)
)
). getClobVal()
IN l_xmldoc
Of
fnd_flex_value_sets fvs,
fnd_flex_values_vl fv
WHERE 1 = 1
-to be replaced by the name parameter value
AND fvs.flex_value_set_name = 'iPROMIS_POST_GL_AFK01_ENTITEIT. '
AND fvs.flex_value_set_id = fv.flex_value_set_id
AND fv.summary_flag = 'n';
dbms_xslprocessor.clob2file (l_xmldoc, l_file_path, l_file_name, nls_charset_id ('UTF8'));
END;
/
The XML format we want to generate is less than
============================================
< financialorganization:LegalEntityList
' xmlns:financialorganization = ' http://schema.bppost1.be/entities/financial/financialorganization/V001 "
' xmlns:basetype = ' http://schema.bppost1.be/entities/base/BaseTypes/V001 "
" xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance ">
< financialorganization:LegalEntity >
< financialorganization:LegalEntityCode > 12345 < / financialorganization:LegalEntityCode >
< financialorganization:Description > Test Description < / financialorganization:Description >
< basetype:ValidityPeriod >
< basetype:OpenEndedPeriod >
< basetype:StartDate > 1900 - 01 - 01 < / basetype:StartDate >
< / basetype:OpenEndedPeriod >
< / basetype:ValidityPeriod >
< / financialorganization:LegalEntity >
< financialorganization:LegalEntity >
< financialorganization:LegalEntityCode > 54321 < / financialorganization:LegalEntityCode >
Test Description1 < financialorganization:Description > < / financialorganization:Description >
< basetype:ValidityPeriod >
< basetype:OpenEndedPeriod >
< basetype:StartDate > 1900 - 01 - 01 < / basetype:StartDate >
< / basetype:OpenEndedPeriod >
< / basetype:ValidityPeriod >
< / financialorganization:LegalEntity >
< / financialorganization:LegalEntityList >
Kind regards
Pirre
You must use the XMLAGG function to group LegalEntity items in a single fragment.
Also use XMLSERIALIZE instead of the getClobVal method (it is not recommended).
SELECT XMLSerialize(document XMLElement("financialorganization:LegalEntityList", xmlattributes('http://schema.bppost1.be/entities/financial/financialorganization/v001' "xmlns:financialorganization", 'http://schema.bppost1.be/entities/base/basetypes/v001' "xmlns:basetype", 'http://www.w3.org/2001/XMLSchema-instance' "xmlns:xsi"), XMLAgg( xmlelement("financialorganization:LegalEntity", xmlelement("financialorganization:LegalEntityCode", fv.flex_value), xmlelement("financialorganization:Description", fv.description), xmlelement("basetype:ValidityPeriod", xmlelement("basetype:OpenEndedPeriod", xmlelement("basetype:StartDate", TO_CHAR(start_date_active,'YYYY-MM-DD')), xmlelement("basetype:EndDate", TO_CHAR(end_date_active, 'YYYY-MM-DD')) ) ) ) ) ) ) INTO l_xmldoc FROM fnd_flex_value_sets fvs, fnd_flex_values_vl fv WHERE 1 = 1 -- to be replaced by value set name parameter AND fvs.flex_value_set_name = 'iPROMIS_POST_GL_AFK01_ENTITEIT' and fvs.flex_value_set_id = fv.flex_value_set_id and fv.summary_flag = 'N';
-
How to write the xml data to a file
Hi all
We have a requirement of writing, the xml data in a file in the data directory in the server. Generate xml data using the SQL below.
SELECT XMLELEMENT ("LINE",
XMLELEMENT ('CELL', xmlattributes (LIKE 'column name', ' EBIZCZMDL_01'), inventory_item_id).
XMLELEMENT ('CELL', xmlattributes (AS 'Name of COLUMN', ' EBIZFFMT_01'), attribute29).
XMLELEMENT ('CELL', xmlattributes ("COMMON" AS "Name of COLUMN"), inventory_item_id |) '' || attribute29 | "ITM")
"XMLDATA" AS "PRODUCE")
OF apps.mtl_system_items_b
When we try to write this query data in a file using UTL_FILE.put_line, the script gives error
PLS-00306: wrong number or types of arguments in the call to "PUT_LINE '.
If anyone can help pls...
Thanks in advanceThe call to dbms_xslprocessor.clob2file is in the cursor for the specific SQL loop.
This is obviously the problem.
The file is replaced with each iteration.Do not use a cursor at all.
See the example below, it should be close to your needs:
DECLARE l_file_name VARCHAR2 (30); l_file_path VARCHAR2 (200); l_xmldoc CLOB; BEGIN l_file_path := '/usr/tmp'; l_file_name := 'TEST_XREF4.xml'; SELECT XMLElement("xref", xmlattributes('http://xmlns.oracle.com/xref' as "xmlns"), XMLElement("table", XMLElement("columns", XMLElement("column", xmlattributes('EBIZFFMT_01' as "name")) , XMLElement("column", xmlattributes('COMMON' as "name")) , XMLElement("column", xmlattributes('EBIZQOT_01' as "name")) , XMLElement("column", xmlattributes('EBIZCZMDL_01' as "name")) , XMLElement("column", xmlattributes('EBIZCZGOLD_01' as "name")) ), XMLElement("rows", XMLAgg( XMLElement("row", XMLElement("cell", xmlattributes('EBIZCZMDL_01' AS "colName"), inventory_item_id) , XMLElement("cell", xmlattributes('EBIZFFMT_01' AS "colName"), attribute29) , XMLElement("cell", xmlattributes('COMMON' AS "colName"), inventory_item_id || '' || attribute29 || 'ITM') ) ) ) ) ).getClobVal() INTO l_xmldoc FROM apps.mtl_system_items_b WHERE attribute29 IS NOT NULL ; dbms_xslprocessor.clob2file(l_xmldoc, l_file_path, l_file_name, nls_charset_id('UTF8')); END; /
BTW, the directory in DBMS_XSLPROCESSOR parameter. CLOB2FILE must be an Oracle Directory object, not a literal path.
-
How to filter the XML related to drop-down list data source?
Dear all,
I quiet new to LiveCycle designer ARE for a few weeks I am working on it.
Right now I have problem with filering XML Datasource with the drop-down list.
I have XML files which includes data for the States and the city. I have one of my drop-down list associated with the State. My requirement is that I chose the 'State' the corresponding city names must appear in the second drop-down list.
I searched the net and got two or three samples on it. But I failed to do my job of form as a requirement. Even if I generated the XML file structure given in the examples.
Please check the attached xml file that I created.
I have struckup right away. So, help me do this.
Very much thanks in advance.
Kind regards
Sree Harshavardhana.
Hello
Your xml structure is virtually identical to one the week last with a similar question, http://forums.adobe.com/thread/518731.
I've renamed the fields required in the attached example.
It will be useful.
Bruce
-
How to write the CLOB parameter to a file or a XML using shell script?
I run an oracle stored procedure using shell script. How can I get the OUT of the procedure (CLOB) parameter and write it to a file or a XML in UNIX environment using shell script?
Edit/Delete MessageSQL> var c clob SQL> SQL> begin 2 select 3 DBMS_XMLGEN.getXML( 4 'select rownum, object_type, object_name from user_objects where rownum <= 5' 5 ) into :c 6 from dual; 7 end; 8 / PL/SQL procedure successfully completed. SQL> SQL> set long 999999 SQL> set heading off SQL> set pages 0 SQL> set feedback off SQL> set termout off SQL> set trimspool on // following in the script is not echo'ed to screen set echo off spool /tmp/x.xml select :c from dual; spool off SQL> SQL> --// file size SQL> !ls -l /tmp/x.xml -rw-rw-r-- 1 billy billy 583 2011-12-22 13:35 /tmp/x.xml SQL> --// file content SQL> !cat /tmp/x.xml
1 TABLE BONUS 2 PROCEDURE CLOSEREFCURSOR 3 TABLE DEPT 4 TABLE EMP 5 TABLE EMPTAB -
How to get the specific information of hardware and software data center
How to get the specific information of hardware and software data center with powercli...
What kind of information you need?
No matter what Esxi host hardware info., if so could below thread is useful.
Information about the host material with information on the nic and HBA drivers
-
Open XML, how to write the path
Hello
I'm new to the Blackberry development and I hope you can help me with my problem. I try to work with an XML file, and so far, all that does very well as long I had the xml file, I work on, in the folder of my java application and deyployed using the desktop software. Now, I tried to put the file somewhere else on the Blackberry and I don't know how wirte the path to the source code. I tried the following, but it seems to be bad:
private static String _xmlFileName = "file:///store/home/user/documents/test.xml"; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); InputStream inputStream = getClass().getResourceAsStream( _xmlFileName ); Document document = builder.parse( inputStream );
I hope you can give me a hint, how I write the correct path?
Thank you very much!
Best regards, jtr87
PS: Sorry for my bad English, but I did not use it very often.
You need to do something like that to get your InputStream:
/** * @return an open InputStream for a file, or null if file does not * exist. * @throws IOException if there is an error opening the file */InputStream getInputStream(String name) throws IOException { FileConnection fc = null; try { fc = (FileConnection) Connector.open(name, Connector.READ); if (fc.exists()) { return fc.openInputStream(); } } finally { if (fc != null) { try { fc.close(); } catch (Exception ignored) { } } } return null; }
Notice that you must close the FileConnection at some point, regardless of if the call to openInputStream worked.
-
run the XML content in a document
Right now I use the following for a placement of XML workflow. Import XML with a script from the CS5 Scripting Guide. I shoot to the top of the group structure and I drag and drop the root XML element in the document, the document automatically adds pages and inserts the contents of the XML file. That's exactly what I would like to be able to do, but with a script. How can I accomplish this? Also, what would be the term appropriate for this sort of thing? I think that "reinvest the XML content in the document", but I wonder if there is a more precise term.
Thanks for having an and any assistance provided.
Pretty much just that, I think:
var doc = app.activeDocument; var frame = doc.masterSpreads[0].textFrames[0].override(doc.pages[0]); frame.markup(doc.xmlElements[0]);
(Not tested).
Jeff
-
How to make the recommended content
Hi all
I want to know, how can I make particular discussion featured content. For example, some of the information that may be important for others. Do we need special rights for who?
Who normally publish such content? How we can find this person or get the same right.
There are many scenarios such as writing articles, reviews, notification and upload videos for specific products.
Please share information.
Vinay
Yes, you need special rights to do this.
Spaces and various communities 'belong' by different people within Oracle, and usually they will be the person who manages this area and decides what content should be made available in the documents or the etc recommended content.
If it is open to anyone to do these things, then we will be people posting all sorts of nonsense they thought was good, without adequate control and most likely stuff that are spam or promote themselves, or their sites Web etc, obviously, it must be controlled, and it must be done in a way that allows content to be verified first (for legal reasons) and is not conditioned so that people are overwhelmed by a steady flow of new features that are more than what they can handle.
The community managers:
Laura Ramsey-Oracle data - base
Middleware/Architecture - Bob Rhubart-Oracle
Systems/Linux, etc. -Logan Rosenstein-Oracle
Java - Yolande Poirier-OracleThere are also the owners of the space such as Steven Feuerstein within PL/SQL etc.
-
How to write the script in FDMEE below.
How to write the script in FDMEE below.
Script below is the FDM Script.How write in FDMEE.
If (varValues (14) '113101' =) OR (varValues (14) '113201' =) OR (varValues (14) '113301' =) OR (varValues (14) = "252111") OR (varValues (14) '156101' =) then
Result = "21_asd."
Please help me on this issue.
Kind regards
Satheesh, S
If you want to determine the id of the target account your opening assignment statement must be:
Account = fdmRow.getString ("ACCOUNTX")
As if - elif-instructions else keep lowercase stream operators. If you continue a command on multiple lines, then place parentheses is
If (account == "113101") or (account == "113201") or (account == "113301") or (account == "113401") or (account == "113501") or (account == "113601") or (account == "215101") or (account == "215201") or (account == "215301") or (account == "215401") or (account == "215501") or (account == "215601") or (account == "252111") or (account == "156101"):
fdmResult = "21_ADNIP".
should be (also get rid of the unnecessary parentheses)
If (account is "113101" account is "113201" or account is '113301' account is "113401" or account is "113501" or account is "113601" or account is "215101" or account is "215201" or account is "215301" or account is "215401" or account is "215501" or account is "215601" or account is "252111" or account is "156101"):
fdmResult = "21_ADNIP".
-
How to write the even-odd fill feature?
How to write the even-odd fill feature?
Maybe like this:
app.executeMenuCommand ('* ');
There is a command in the PathItem object named evenodd. I think that if you change the property of evenodd and get a member of a composite path path, you can achieve a desired result.
-
Hello
How to write the sql query
I have three type of table as
1 table emp
EMP_ID FIRST_NAME DEPT_ID
---------- -------------------- ----------
1 kumar 10
2 sam 20
3 30 damu
2 table dept
EMP_ID SALE_ID DEPT_ID
---------- ---------- ----------
1 101 10
2 102 20
3 103 30
3. table sale
EMP_ID SALE_ID SALE_AMT
---------- ---------- ----------
1 101 7
2 102 8
3 103 9
I want the result as
EMP_ID DEPT_ID SALE_AMT
------- --------- - --------
1 10 7
Thank you
Are you looking for this?
SELECT T1. EMP_ID,
T1. DEPT_ID,
W3M SALE_AMT
FROM EMP T1,
SALE T3
WHERE T1. EMP_ID = T3. EMP_ID;
OUTPUT:
EMP_ID DEPT_ID SALE_AMT
------- ---------- ----------
1 10 7
2 20 8
3 30 9
If this is not the case, after the actual output, you need. Because that gives you the amount of sales deptwise
-
How to write the 'C' alpabelt within a circle of author?
Hello
How to write the symbol of copyright on first Pro CC (ie the alpabelt 'C' inside a circle) ?
Thank you
On a Mac, Option + G.
MtD
-
Y at - it a tutorial step by step on how to program the web content viewer to resize
II working on my portfolio site and have two or three projects DPS that I want to post in here and need to know how to change the web content viewer to take account of the different screen size. Than you.
If you use a web viewer that is integrated, this Developer Network article provides information on how to resize:
Resizing of the integrated Web Viewer | Adobe Developer Connection
Thank you
Brian
-
How to write the query option in expdp
Hi Please someone help me how to write the query option in expdp... .in expdp using the query option...
where AM columnname between 5 May 12 02:57:00.000' and ' 02:59:59.999 6 May 12: ';
Please do what is necessary...Pavan Kumar says:
QUERY = (columnname scott.test: "where between 5 May 12 02:57:00.000 h ' and ' 6 May 12 AM 02:59:59.999'")Who will fail in databases, because you assume nls_date_format. How it is difficult to put to_date() surround channels? Rather than play with quotation marks, using one parfile thusly.
query=table_owner.table_1:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')" query=table_owner.table_2:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')" query=table_owner.table_3:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')"
You do not have to have all the clauses in a single line, as they are side by side parfile, which would be enough. For this reason parfile is better than the command line in order to avoid all the back-citing dance.
Maybe you are looking for
-
My iCloud says I have 10.5 MB of documents stored in it. I have no idea what are these documents and I would like to know. When I click on the button manage on the right I just get this. Which tell me what are the 10.5 MB of documents. When I go to F
-
iBook want to put an internet connection - internet last was microsofts 5.1
I have an iBook G3 Power PC - version 10.0.3 processor build4P13. The last time that I was able to get on Internet Exploer Version 5.1b1 (5502) says that it is compatible with mozilla 4.0... How do I get Mozilla 4.0 on the computer without internet c
-
I had failures where time machine has failed to create a backup. I was able to work around the problem by rebooting my mac. After I do it, I select the time machine icon on the line top of the machine and do a 'back up now '. Then it's successful.
-
How to avoid ruining the recovery on Satellite L550 partitions
Hi all I recently bought the Satellite L550/010. I'll put another OS on it, but I want to assure you that I can still retrieve its state of origin. It came with the following partitions: First partition (1.5 GB): contains the directories 'Boot', 'rec
-
Extensions for Photos for Mac; can convert RAW Photos?
Downloaded "2016 creative Kit" on the site of macphun fairly recently so don't always do not have much with CK apps. I like the clean interface of Snapheal and intensify and had a go using these with the opening and Photos: the process is smoother wi