Moving xml file from table stored as clob to table stored as binary
We have an xml file we are trying to move from a 10g database to 11gR2. The 11gR2 table is stored as binary, and when we try to insert the row into this table across a dblink from the 10g database the table locks and the system will not complete the transaction. I am wondering if this has something to do with the way the files are stored?
This would be better in the {forum:id=34} forum. Also include the full version of the 10g DB and the SQL being used and which DB it is running on.
Similar Messages
-
Newbie - XML File - How to load data and populate tables
Hi,
I'm newbie to XML data handling.
I have a file that is provided in XML format with data from an external system.
I need to load data from that file and populate some field in one or more tables.
I have two options:
1. Load the XML file directly from OS and populate the tables directly (I'm not sure if this is possible or not)
2. Load the entire XML file from OS into a CLOB or a BLOB(?) and the select the data form the CLOB and populate my tables.
I need some guidance about what is possible and how to do it.
My preferred approach if possible is to load the data directly from OS and populate the target tables without loading into the database previously.
Thanks for the help.
Tech Info:
OS : Unix / Windows
DB Version: 11.2 or 11.1
JFforum has many examples
use search
as example see
Re: Load xml data in Oracle table
Re: Load an XML file into table(s)
Re: load a file -
Reading XML file from specific location&Storing xmldata into related tables
I am new to xml.
My requirement is,
1) Get the xml file from specified location (C:\xmlfiles\ xmldata.xml)
2)Convert xml data in clob data.
3)store the data into related table.
and vice-versa.
What i did,
a) I got the data from related tables and converted into xmlformat using SQLX
b)converted this resultset into clob data and stored as xml file in specific location.
It uses more then ten tables.
All this help i got from AskTom site , thanks for that.
Now i have to do vise-versa, i.e. i have to perform 1), 2), 3) steps........
Please tell me proper steps to acheive it.
Thanks in advance for giving your precious time to solve my issue.Have you read the"XMLDB FAQ" in this Forum?
You could use stuff like:
create or replace directory xmldir as C:\xmlfiles'
declare
xmldata xmltype;
begin
xmldata := xmltype(bfilename('XMLDIR','xmldata.xml'),nls_charset_id('AL32UTF8'));
-- etc, etc your code --
-- --> convert to clob by using for instance getclobval() function
-- --> then insert the data in your relational table with CLOB column
-- etc, etc your code --
end;
/ -
Reading Xml file from clob column in the staging table
Hi,
I am trying to poll the staging table with the database adapter which has CLOB column type containing XML file. How do I extract the XML file from CLOB and map the fields to the another variable with definite schema.
Thanks,
Edited by: chaitu123 on Sep 20, 2009 8:16 AM1) when you create DBAdapter on a table which having the clob column watch closely the created xsd for the DBAdapter the clob cloumn element should be a String data type
2) create xsd for Xml File and create variable for the xsd element
3) use ora:parseEscapedXML("yourDBAdapterclobElement") to XmlFileVarilable
Krishna -
Create XML file from table data
Dear All,
with dataservice 4.0, I want to create an XML file from a table data.
Table have a single column but more record, for example:
0001000488;100;EUR;
0001000489;200;EUR;
0001000450;300;EUR;
My desired XML output:
<Data>
0001000488;100;GBP;
0001000489;200;EUR;
0001000450;300;EUR;
</Data>
I try with a sample query but the sistem write only the last record in XML file:
<Data>
0001000450;300;EUR;
</Data>
Can everyone help me?
Thank in advance.
SimoneHello
That is a very simple (also odd) XML document structure, and as such doesn't require use of the XML target. It can be easily acheived by writing a normal file with a header and footer, which is acheived using a row_generation and a query to generate the hard coded open and close tags.
Michael -
Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.The Oracle documentation has a good overview of the options available
Generating XML Data from the Database
Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
You can also find some information in XML DB FAQ -
Issue with uploading XML file from application server into internal table
i Need to fetch the XML file from the application server and place into internal table and i am getting error message while using the functional module SMUM_XML_PARSE and the error message is "line 1 col 1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment" and could you please let me know how to resolve this issue?
TYPES: BEGIN OF T_XML,
raw(2000) TYPE C,
END OF T_XML.
DATA:GW_XML_TAB TYPE T_XML.
DATA: GI_XML_TAB TYPE TABLE OF T_XML INITIAL SIZE 0.
DATA:GI_STR TYPE STRING.
data: GV_XML_STRING TYPE XSTRING.
DATA: GI_XML_DATA TYPE TABLE OF SMUM_XMLTB INITIAL SIZE 0.
data:GI_RETURN TYPE STANDARD TABLE OF BAPIRET2.
OPEN DATASET LV_FILE1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC NE 0.
MESSAGE 'File does not exist' TYPE 'E'.
ELSE.
DO.
* Transfer the contents from the file to the work area of the internal table
READ DATASET LV_FILE1 INTO GW_XML_TAB.
IF SY-SUBRC EQ 0.
CONDENSE GW_XML_TAB.
* Append the contents of the work area to the internal table
APPEND GW_XML_TAB TO GI_XML_TAB.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
* Close the file after reading the data
CLOSE DATASET LV_FILE1.
IF NOT GI_XML_TAB IS INITIAL.
CONCATENATE LINES OF GI_XML_TAB INTO GI_STR SEPARATED BY SPACE.
ENDIF.
* The function module is used to convert string to xstring
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = GI_STR
IMPORTING
BUFFER = GV_XML_STRING
EXCEPTIONS
FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE 'Error in the XML file' TYPE 'E'.
ENDIF.
ENDIF.
IF GV_SUBRC = 0.
* Convert XML to internal table
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
XML_INPUT = GV_XML_STRING
TABLES
XML_TABLE = GI_XML_DATA
RETURN = GI_RETURN.
ENDIF.
READ TABLE GI_RETURN TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.
IF SY-SUBRC EQ 0.
MESSAGE 'Error converting the input XML file' TYPE 'E'.
ELSE.
DELETE GI_XML_DATA WHERE TYPE <> 'V'.
REFRESH GI_RETURN.
ENDIF.Could you please tel me why the first 8 lines were removed, till <Soap:Body and also added the line <?xml version="1.0" encoding="UTF-8"?> in the beggining .
Becuase there will be lot of XML files will be coming from the Vendor daily and that should be uploaded in the application server and should update in the SAP tables based on the data in the XML file.
what information i need to give to vendor that do not add the first 8 lines in the XML file and add the line in the beggining <?xml version="1.0" encoding="UTF-8"?> ??????
Is there any other way we can do with out removing the lines? -
How to read a XML file from BLOB column and insert in a table - PL/SQL Only
Hi,
To make data load more simple to end user instead placing file on the server and use SQL-LOADER, I came up with new idea that using oracle ebusiness suite attachment functionality. that loads a XML file from local PC to a database column(table is fnd_attachments, default data type is BLOB over here).
I tried with DBMS_LOB and didnt get around.
Please can anyone tell me how to read the BLOB column using PL/SQL and store the data in a oracle table. Here's the sample XML file and table structure FYI.
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Corporate_alloc.xsd" generated="2009-07-07T14:17:49">
<Corporate_alloc>
<PKG_CODE>BKCORP</PKG_CODE>
<PKG_NAME>Corporate Edition - Books</PKG_NAME>
<DET_CODE>B9780080543758</DET_CODE>
<DET_NAME>Waves, Tides and Shallow-Water Processes</DET_NAME>
<ALLOCATION_RATIO>0.000041</ALLOCATION_RATIO>
</Corporate_alloc>
<Corporate_alloc>
<PKG_CODE>BKCORP</PKG_CODE>
<PKG_NAME>Corporate Edition - Books</PKG_NAME>
<DET_CODE>B9780080534343</DET_CODE>
<DET_NAME>Hydrostatically Loaded Structures</DET_NAME>
<ALLOCATION_RATIO>0.000127</ALLOCATION_RATIO>
</Corporate_alloc>
</dataroot>
CREATE TABLE TEST_XML
( PKG_CODE VARCHAR2(50),
PKG_NAME VARCHAR2(100),
DET_CODE VARCHAR2(20),
DET_NAME VARCHAR2(500),
ALLOCATION_RATIO NUMBER )
Thanks
EBVIn regards to #3, use the COLUMNS functionality of XMLTable instead of using Extract. Two simple examples are
Re: XML Data - Caliculate fields
Re: Extractvalue function not recognised -
Creating an XML file from multiple sql tables
I have very little xml experience, but need to generate an xml file from multiple table. I know what the output needs to look like, but do not know how to setup the code. Any help would be appreciated.
- <Practice SourceID="EPIC" ExternalPracticeID="PPAWB">
- <Provider ExternalProviderID="TB2" FirstName="THOMAS G" LastName="BREWSTER">
- <Patient ExternalPatientID="99999" OldExternalPatID="" FirstName="test" MiddleName="J" LastName="test" Gender="M" DateOfBirth="2005-08-12" SocSecNumber="000-00-0000" LanguageID="22" AddressOne="test" AddressTwo="" City="test" StateID="20" ZipCode="99999" DayPhone="" EveningPhone="207-999-9999" StatusID="">
<Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
<Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
<Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
<Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 14:23:00" />
<Measure MeasureID="32" MeasureValue="3" MeasureDate="2008-10-24 13:51:00" />
<Measure MeasureID="33" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
<Measure MeasureID="33" MeasureValue="1" MeasureDate="2009-02-09 10:09:00" />
<Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
<Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
<Measure MeasureID="40" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
<Measure MeasureID="40" MeasureValue="2008-10-24 14:23:00" MeasureDate="2008-10-24 14:23:00" />
<Measure MeasureID="41" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
<Measure MeasureID="41" MeasureValue="2008-10-24 13:51:00" MeasureDate="2008-10-24 13:51:00" />
</Patient>
</Provider>
</Practice>You are interested in XMLElement and probably XMLAgg. Since you didn't list a version, I can't provide links to the corresponding documentation. I cringe at all the attributes on the Patient element as that info should really be elements.
To create the Measure node, your overall SQL statement may look something like (not tested)
SELECT XMLElement....
XMLAgg(SELECT XMLElement
FROM measures_table
WHERE join condition to parent)
FROM patient,
provider,
practice
WHERE join conditionsFor additional help, please include your version (4 digits), some sample data, and what you have tried. -
Create a xml file from an internal table: CALL TRANSFORMATION
Hello gurus,
I want to create a xml file using data from scustom table. I will create an internal table and will select some records to it.
I searched the forum and i discovered the call transformation, but when i execute the example program at the CALL TRANSFORMATION shows a dump screen.
How we create a xml file from internal table??
Please help me. I will mark the useful answers.I'm using if_ixml class to create xml documents
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
DATA: o_ixml TYPE REF TO if_ixml,
o_document TYPE REF TO if_ixml_document,
o_element TYPE REF TO if_ixml_element,
o_streamfactory TYPE REF TO if_ixml_stream_factory,
o_ostream TYPE REF TO if_ixml_ostream,
o_renderer TYPE REF TO if_ixml_renderer.
DATA: t_xml_table TYPE TABLE OF xml_line,
v_xml_size TYPE i.
o_ixml = cl_ixml=>create( ).
o_document = o_ixml->create_document( ).
* The o_document have a set of methods to add elements, attributes, etc.
o_element = o_document->create_simple_element(
name = 'RootNode'
value = 'some text'
parent = o_document ).
o_streamfactory = o_ixml->create_stream_factory( ).
o_ostream = o_streamfactory->create_ostream_itable( table = t_xml_table ).
o_renderer = o_ixml->create_renderer( ostream = o_ostream document = o_document ).
o_renderer->render( ).
v_xml_size = o_ostream->get_num_written_raw( ).
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = v_xml_size
filename = 'C:a.xml'
filetype = 'BIN'
CHANGING
data_tab = t_xml_table. -
Upload XML file from Application Server to Internal Table
Hi Experts,
i have xml file in application server and i want to convert to internal table .
i have tried this link http://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table.
Here the file is loaded from local(presentation Server) ..
i want to know how to select file from application layer ..and schedule in background..
i also tried FM '/SAPDMC/LSM_F4_SERVER_FILE' but this need front end selection of file from application server..
i need to select a xml file from application server and convert into internal table in background.. help me on this..Have a look on
Re: How to convert XML data to different ABAP internal table
Thanks
Ravin -
How to create xml file from relational tables in 10gR2
Hi,
I am very new to XML and was wondering how to create an XML file from querying relational tables. Some child tables may contain multiple rows that need to be returned in certain instances. Other queries will just be single or multiple rows from one or more tables. I would like to use the latest feathers in 10gR2. Thanks for any help you can provide.
Thanks,
LeeHere is the first row of data created from our person table - it used the column names as the tag names:
<?xml version="1.0"?>
<ROWSET>
<ROW>
<MP_ID_SEQ>289</MP_ID_SEQ>
<MP_NAME>LOBERG,JUDITH LEE</MP_NAME>
<MP_SEX>F</MP_SEX>
<MP_RACE>I</MP_RACE>
<MP_DOB>19500709</MP_DOB>
<MP_HT>504</MP_HT>
<MP_WT>170</MP_WT>
<MP_EYE_CLR>BLU</MP_EYE_CLR>
<MP_HAIR_CLR>BRO</MP_HAIR_CLR>
<MP_SKN>RUD</MP_SKN>
<MP_SMT>POCKMARKS</MP_SMT>
<MP_SOC>517607968</MP_SOC>
<MP_OLN>517607968</MP_OLN>
<MP_OLS>MT</MP_OLS>
<MP_OLY>2007</MP_OLY>
<MP_CAUT_MED>70</MP_CAUT_MED>
<MP_VISION_SCRIPT>C0RRECTIVE LENSES</MP_VISION_SCRIPT>
<MP_DNA_AVAIL>N</MP_DNA_AVAIL>
<CREATED_BY>MMPS</CREATED_BY>
<DTM_CREATED>31-AUG-06</DTM_CREATED>
<MI_INC_ID_SEQ>288</MI_INC_ID_SEQ>
<MP_ALERT>N</MP_ALERT>
</ROW> -
How to generate XML file from a table without using UTL_FILE that too in local machine...
You downloaded the wrong XML Parser!
XSQL requires Java Parser. Well, there's a copy included with the XSQL package so you actually don't need to do another download.
You really don't need XSQL if you just want a XML file from DB, you just needed a XML SQL Utility. Download that and run the samples. -
Generating xml file from database table
Could anyone please explain how to generate a xml file from a database table.examples will be highly appreciated.
thanks in advanceSee the release notes for our XSQL Pages component of the Java XDK for a tutorial. There are also lots of examples in Building Oracle XML Applications.
You use the XML SQL Utility component to accomplish the task. It's part of our Java XDK that you can download from http://otn.oracle.com/tech/xml -
Generate XML file from an Oracle Database Table
Hello All,
I want to generate a xml file from an Oracle Database table which contains a blob column.
Can somebody give pointers on this please.
Thanks in advance
SulakshanaUse the DBMS_XMLGEN package.
Maybe you are looking for
-
TS3276 One person does not get my email
I am able to send and recieve email from everyone in my address book except one. I have checked the email address.; delted and re-entered still no dice. Any ideas why this person can bot recieve my emais. Thanks dc
-
Hi gurus, I am having a hard time trying to inherit the profit centers from the original documents for follow on documents such as Interest. Do you know if there is any event or standard configuration where I should indicate that the profit center sh
-
IP profile increase/decrease
My internet IP profile was 77.4mb was stable, on the 7 day i turn my modem off as i bought a new computer so had to switch it off to move it about, the profile when dropped to 64.2mb then i turn if off again to see if the profile would increase back
-
How can i start listener?
i have installed oracle8.1.6 on solaris7,but i cannot start the listener. the following is the error message. LSNRCTL> start listener Message 1070 not found; No message file for product=network, facility=TNSTNSLSNR for Solaris: Version 8.1.6.0.0 - Pr
-
For JCO , rfc gate way ,bridge, cannot find need help
Hi! I am not sure about sneak preview but who are you logged in as when you say "can't find sld"? What happens when you try to go to "http://localhost:500XX/sld" ? Any message? Thanks BMG