How to load xml with large base64 element using sqlldr

Hi,
I am trying to load xml data onto Oracle 10gR2. I want to use standard sqlldr tool if possible.
1) I have registered my schema with succes:
- Put the 6kbytes schema into a table
- and
DECLARE
schema_txt CLOB;
BEGIN
SELECT text INTO schema_txt FROM schemas;
DBMS_XMLSCHEMA.registerschema ('uddkort.xsd', schema_txt);
END;
- Succes: I can create table like:
CREATE TABLE XmlTest OF XMLTYPE
XMLSCHEMA "uddkort.xsd"
ELEMENT "profil"
- USER_XML_TABLES shows:
TABLE_NAME,XMLSCHEMA,SCHEMA_OWNER,ELEMENT_NAME,STORAGE_TYPE
"XMLTEST","uddkort.xsd","THISE","profil","OBJECT-RELATIONAL"
2) How can I load XML data into this?
- One element of the schema is <xs:element name="billede" type="xs:base64Binary" minOccurs="0"/>
- This field in data can be 10kbytes or more
I have tried many control files - searching the net, but no luck so far.
Any suggestions?
/Claus, DK

- One element of the schema is <xs:element name="billede" type="xs:base64Binary" minOccurs="0"/>
- This field in data can be 10kbytes or moreThe default mapping in Oracle for this type is RAW(2000), so not sufficient to hold 10kB+ of data.
You'll have to annotate the schema in order to specify a mapping to BLOB datatype.
Something along those lines :
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
<xs:element name="image" xdb:defaultTable="IMAGES_TABLE">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="content" type="xs:base64Binary" xdb:SQLType="BLOB"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
</xs:schema>http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb05sto.htm#sthref831
Then :
SQL> begin
  2   dbms_xmlschema.registerSchema(
  3   schemaURL => 'image.xsd',
  4   schemaDoc => '<?xml version="1.0"?>
  5  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
  6  <xs:element name="image" xdb:defaultTable="IMAGES_TABLE">
  7    <xs:complexType>
  8      <xs:sequence>
  9        <xs:element name="name" type="xs:string"/>
10        <xs:element name="content" type="xs:base64Binary" xdb:SQLType="BLOB"/>
11      </xs:sequence>
12    </xs:complexType>
13  </xs:element>
14  </xs:schema>',
15   local => true,
16   genTypes => true,
17   genTables => true,
18   enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
19   );
20  end;
21  /
PL/SQL procedure successfully completed
SQL> insert into images_table
  2  values(
  3    xmltype(bfilename('TEST_DIR', 'sample-b64.xml'), nls_charset_id('AL32UTF8'))
  4  );
1 row inserted
where "sample-b64.xml" looks like :
<?xml version="1.0" encoding="UTF-8"?>
<image>
<name>Collines.jpg</name>
<content>/9j/4AAQSkZJRgABAgEBLAEsAAD/7QlMUGhvdG9zaG9wIDMuMAA4QklNA+0KUmVzb2x1dGlvbgAA
AAAQASwAAAABAAEBLAAAAAEAAThCSU0EDRhGWCBHbG9iYWwgTGlnaHRpbmcgQW5nbGUAAAAABAAA
AHg4QklNBBkSRlggR2xvYmFsIEFsdGl0dWRlAAAAAAQAAAAeOEJJTQPzC1ByaW50IEZsYWdzAAAA
O9r8FHXdH4LDSSUHoImAmcIcQPwWAkkh3ogKI404WGkkkO8Po/EpmmCYWEkkru7z/FJg9sRqsFJJ
XR3iPZMJN1HmsFJJXT6u+3UQdJUJj7lhpJKHV32dh96i3Qx8lhJJK7u9w4jw7p+SCsBJJDukQ7Tu
VM6Ln0klHo7rjEeak0rASST0f//Z</content>
</image>BTW, open question to everyone...
XMLTable or XMLQuery don't seem to work to extract the data as BLOB :
SQL> select x.image
  2  from images_table t
  3     , xmltable('/image' passing t.object_value
  4         columns image blob path 'content'
  5       ) x
  6  ;
ERROR:
ORA-01486: size of array element is too large
no rows selectedhowever this is OK :
SQL> select extractvalue(t.object_value, '/image/content') from images_table t;
EXTRACTVALUE(T.OBJECT_VALUE,'/IMAGE/CONTENT')
FFD8FFE000104A46494600010201012C012C0000FFED094C50686F746F73686F7020332E30003842
494D03ED0A5265736F6C7574696F6E0000000010012C000000010001012C0000000100013842494DIs there a known restriction when dealing with LOB types?
Edited by: odie_63 on 17 nov. 2011 19:27

Similar Messages

  • How to add XML attribute to an Element using BPEL assign

    I have a request xml to a bpel process that does not contain a attribute.
    After some process I need to create this missing attribute and set a value.
    I tried using the XML fragment in the Assign Activity. But how can I create a attribute?
    This XML node to which I am trying to create an attribute is a very huge node with lot of dynamic typing(xsi:type). I can just re-create the complete xml with required nodes.
    Does any one know how I can create a xml attribute using the BPEL assign? I do not want to use the Java code in my process.
    Thanks.

    I'm bit confused about what exact problem you are facing with attributes.
    You can check accessing XML attributes in BPEL Assign @ http://download.oracle.com/docs/cd/E12483_01/integrate.1013/b28981/manipdoc.htm#BABIHDHI from the page http://download.oracle.com/docs/cd/E12483_01/integrate.1013/b28981/manipdoc.htm.
    I suppose your source input has no attributes and destination has to be an xml with attribute of type xsi:type. You can use the assign activity as mentioned in above document to assign your type structure to type attribute.

  • Parsing XML with binary (Base64) elements

    Can someone give me an example or point me towards some resources that discuss parsing, and rendering binary elements (.gif images, specifically) from XML to HTML? Is this a standard function of most parsers?
    THANKS
    ben

    XML is a text format so of course it can't include binary data such as GIFs. But then so is HTML, so there doesn't seem to be much point in doing this. Your HTML would have to include a link to the GIF, rather than the GIF itself in any format, binary or otherwise. And therefore so should the XML. Given all that, it follows that parsers don't deal with whatever it is you are attempting.

  • How does load-balancing with WebCache work - is there still a bottleneck?

    Hello,
    We're migrating an old Forms 6i app to 10.1.2.0.2 (apps servers = Redhat Linux), and are starting to consider using WebCache to loadbalance between two application servers.
    My question is this - say we have apps servers A and B, both running Forms and Reports Services. We use Webcache on server A (don't have the luxury of a third apps server...) to load balance between A and B. So all initial requests come into A, which in some cases may then be diverted to start a new Forms session on B.
    For those users whose middle-tier sessions are now running on B - will all network traffic for their Forms session continue to be routed through Webcache on A, then to B, over the course of the session? Or does Webcache somehow shunt the whole connection to be straight between the client PC and server B, for the duration of that Forms session?
    If the former, does that mean that the server hosting Webcache can still be a significant bottleneck for network traffic? Have people found load-balancing with Webcache to be useful..?
    Thanks in advance,
    James

    Hi gudnyc,
    Thanks for posting on Adobe forums.
    For HDPI you do not have to do any It will adjust automatically.
    http://helpx.adobe.com/photoshop-elements/using/whats-new.html
    Regards,
    Sandeep

  • TS3212 Having problems downloading. OS is LINEX and I'm not sure how to load itunes with it.

    Having problems downloading. OS is LINEX and I'm not sure how to load itunes with it.

    Agreed. No native linux support. The only ways you could run iTunes with a primary linux system would be to a) dual boot, b) virtualize Windows with VirtualBox, VMware, etc., or c) attempt to run iTunes in Wine (which doesn't usually work very well). Dual boot would give you the benefit of complete support and usage of hardware and software, but virtualizing is a bit more convenient, since you would not have to reboot your linux host.

  • How to Load Catalog with given catalog id

    How to load Catalog with given catalog id in ATG
    can any one help on this?
    Thanks in advance.

    Hi ,
    You can use ItemLookUpDroplet :
    $class=atg.repository.servlet.ItemLookupDroplet
    $scope=global
    itemDescriptor=catalog
    repository=/atg/commerce/catalog/ProductCatalog
    In Jsp :
    dsp:droplet name="ItemLookUpDroplet">
    <dsp:param name="id" value="catalog10002"/>
    <dsp:oparam name="output">
    </dsp:oparam>
    </dsp:droplet>
    ~ Praveer

  • How to load date with time zone using sql loader???

    Hi All,
    How to load following value in the table using SQL loader.
    [11/Jan/2006:15:20:14 -0800]
    What should be the datatype of the column in the table. I have tried with "timestamp with local time zone", but unable to load the record using sql loader. What should be the format string in the loader control file to load this type of record.
    Any help in this regard is highly appreciated.
    Sameer

    Try something like this in your control file:
    mycol char "TO_TIMESTAMP_TZ(mycol, 'DD/MON/YYYY:HH24:MI:SS TZH:TZM')"
    [pre]
    Message was edited by:
            Jens Petersen                                                                                                                                                                                                                                                                                                                                                                       

  • Uregnt - How to Load Flat File into BW-BPS using Web Browser

    Hello,
    We have followed the 'How to Load Flat File into BW-BPS using Web Browser' guide to build BSP web front-end to upload flat file.  Everything works great but we have a requirement to populate the Planning Area Variables based on BSP drop down list with values.  Does anyone know how to do this?  We have the BSP coded with drop down list all we need to do now is populate variables.  We can populate the variables through the planning level (hardcoded) but we need to populate them through the web interface.
    Thanks,
    Gary

    Hello Gary,
    We have acheived the desired result by not too a clean method but it works for us.
    What we have done is, we have the link to load file in a page where the variables can be input. The user would then have the option to choose the link to load a file for the layout in that page.
    By entering the variable values in the page, we are able to read the variables for the file input directly in the load program.
    Maybe this approach might help.
    Sunil

  • How to send XML file to https server using POST

    Hi, I am having an requirement, that I have to connect to https server and I have to pass an input XML file as a response server will give me output XML file.
    The certificate validation part is over, I am using FileInputStream to read the XML file and attaching this to connection.getOutputStream(); but server is throwing me DTD does n't match.
    Can any body tell me how to send XML file, I have to use any DOM parser to send the XML file, suggest me and give me sample code.
    Thanks,

    Can anybody give me the solution

  • How i can deal with oracle file by using php api

    how I can deal with oracle file by using php api ?

    What has this to do with Reflections and Reference Objects?

  • How to read XML message present in Table using PL/SQL?

    Hi,
    How to read XML content present in Table using PL/SQL .And is it possible to parse the xml uisng xslt and insert xml output in same table again ?
    Thanks!

    Late reply, but hopefully better late than never.
    You can possibly do it all via a single SQL statement, such as {message:id=4232077}
    XMLTable Syntax can be found at http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions228.htm#CIHGGHFB (for 10.2 users) else find your correct version at http://www.oracle.com/technology/documentation/index.html

  • How do I text with the iPad 2 using cellular device?

    How do I text with the iPad 2 using cellular device? I also have iPhone 4, can I use them both for texting?

    The iPad doesn't have any text over cellular capabilities. You can use apps like Text Free to send texts to non-iOS devices, though.

  • How to load XML files into ORACLE8i database?

    SAP data is being extracted into XML format (via IDOC) files which are being transferred to an ORACLE8i box. There will be a large amount of data transferred on a daily basis which will include updates and inserts. From all the information that I have read on this subject there are 2 options available :
    1. XML-SQL Utility - which converts XML into INSERT, UPDATE or DELETE SQL. There does not appear to be that much functionality available by this method for decodes, transformations on the input data.
    2. SQL*Loader - There was a statement in 1 piece of documentation stating that SQL*Loader could be used for loading XML format data files. I cannot however find any further information on how this is achieved or how it works.
    If anyone has any experience in loading XML format data files using either of the above methods (preferably SQL*Loader as it has more functionality) then could you please provide me with examples or guidance on this matter? Any help would be greatly appreciated as I am not familiar with XML format data files. I am from an Oracle 7.3 background but do not have much experience with Oracle 8 onwards.
    Disclaimer.
    Any views expressed in the above paragraphs are my own and not that of Hewlett Packard Ltd.

    We are loading XML into our database using CLOB datatypes. We don't use the XSU for inserts as it is too slow. We parse the incoming XML document into a PL/SQL record type and then build a generic insert. This might not work well if you have many tags to parse into columns. We also store the entire XML CLOB into a column without parsing the individual tags into separate columns. We then use Intermedia Text for fast, index-based searching within the XML column.
    Check out The Oracle XML Portal website for code examples on how to do this:
    www.webspedite.com/oracle

  • How to load XML file to DB

    Hi All,
    My requirement is I have a XML file, its data should be stored in Database.
    Below is the sample XML file.
    <?xml version="1.0"?>
    <PaymentInfoMessageResponse>
    <PaymentInfoResponse>
    <TransactionType>940</TransactionType>
    <SequenceNum>04</SequenceNum>
    <CompanyCode>902</CompanyCode>
    </PaymentInfoResponse>
    <StatusCode>OK</StatusCode>
    <StatusDetail>OK</StatusDetail>
    <ResponseItemCount>2</ResponseItemCount>
    </PaymentInfoMessageResponse>
    I have a table with columns name say TransType,SeqNum
    the value 940,04 from XML file should be saved in TransType,SeqNum Column respectively
    I am using file adapter with native format builder,selecting file type as complex type and
    In design schema,I'm not able to proceed,i'm getting error in POP up as:
    Native Format builder:error
    No global elements exist.
    How can i proceed or any other way to load XML file to DB.
    urgent Help/suggestion is required.
    Thanks in advance

    HI all,
    1)If my input is .txt file.
    we can use file adapter,using native builder,sample it,
    delimited/fixed length, we can do normal file read and file write/DB write.It works fine.
    2)If my input file is xml file,we can't use native builder format(Because it doesn't support
    delimited/fixed length/complex character in native format builder).
    so,as said in the above reply,i took a sample XML file & converted to XSD using
    File Menu > New > All Technologies tab > General > XML > XML Schema from XML Document.
    It compiles fine.
    Now,if i use file adapter(read) -- BPEL -- File adapter(write).
    Inside Transform,i am mapping filereadVariable and filewrite Variable correctly.
    If my input file is Abc.xml and its contents in read file are:
    <?xml version="1.0"?>
    <PaymentInfoMessageResponse>
    <PaymentInfoResponse>
    <TransactionType>940</TransactionType>
    <SequenceNum>04</SequenceNum>
    <CompanyCode>902</CompanyCode>
    </PaymentInfoResponse>
    <StatusCode>OK</StatusCode>
    <StatusDetail>OK</StatusDetail>
    </PaymentInfoMessageResponse>
    In write folder,my contents are
    <PaymentInfoMessageResponse>
    <imp1:PaymentInfoResponse>
    <imp1:TransactionType/>
    <imp1:SequenceNum/>
    <imp1:ReceiptTime/>
    <imp1:CompanyCode/>
    </imp1:PaymentInfoResponse>
    <imp1:StatusCode/>
    <imp1:StatusDetail/>
    </PaymentInfoMessageResponse>
    Now,if i use file adapter(read) -- BPEL -- DB adapter(merge).
    Inside Transform,i am mapping filereadVariable and DBmerge Variable correctly.
    If my input file is Abc.xml and its contents in read file are:
    <?xml version="1.0"?>
    <PaymentInfoMessageResponse>
    <PaymentInfoResponse>
    <TransactionType>940</TransactionType>
    <SequenceNum>04</SequenceNum>
    <CompanyCode>902</CompanyCode>
    </PaymentInfoResponse>
    <StatusCode>OK</StatusCode>
    <StatusDetail>OK</StatusDetail>
    </PaymentInfoMessageResponse>
    My output in em console is like this.
    <CeStatementHeadersIntCollection>
    <top:CeStatementHeadersInt>
    <top:statementNumber/>
    <top:bankName/>
    </top:CeStatementHeadersInt>
    </CeStatementHeadersIntCollection>
    NO data is being inserted into DB.
    I can write my XMl file into write folder as it is using opaque object(No native format translation)
    I can write XML file into DB using BLOB data type.
    But my requirement is:
    I have a table with columns name say TransType,SeqNum
    the value 940,04 from above XML file should be saved in TransType,SeqNum Columns respectively.
    Can i do it using DOM parser/SAX parser?
    So any suggestion/help required
    Thanks in advance

  • How to load XML File to BW Delta Queue via Webpage

    Hello altogether,
    I am trying to load an CSV file via Webpage (the Webpage have to change the csv file in a xml/soap file) into BW Delta Queue.
    Steps that I have made:
    - Create an InfoSource
    - Create an BW Data Source with Soap Connection
    - Create an initial Delta without Data Transfer
    - Create a Web Service with TC - SE37 - Utilities -> More Utilities -> Create Web Service
    If I test the Web Service with TC - Soamanager (BW 7.0), the data entered here, are transferred to the BW Delta Queue.
    If I test the function module ( TC - SE37), the data also transferred to the Delta Queue.
    Now I think, that I have an error in the html file or the html file is not conform to the wsdl document?? Or should I have to create a virtual interface, but I don't find a possibility to creat it...???
    Can you please help me????
    The coding of the WSDL Document and the Website is attached (I can also send you the coding and error message via mail, if you want). Sorry I don't know how to display here the coding. I try it with symbol "click to display the text code", but afterwards I get an error message from the website...   So let me please know your mail address and I send it via mail....
    I hope, that somebody can help me!!!!!
    Edited by: Alina99 on Sep 8, 2009 11:44 AM
    Error Message from BW:
    ...sap-env:envelope..... soap-env:body><soap-env:fault><faultcode>soap-env:Client</faultcode></faultstring xml:lang="eng">Virtual Interface Method&gt;_-BI0_-QI6AZ_XML_APPL2_RFC::urn:sap-com:document:sap:soap:functions:mc-style&lt;not supported</faultstring>.......
    Edited by: Alina99 on Sep 8, 2009 11:56 AM

    Hello,
    I have done all the necessary config in BW. However, as I mentioned earlier, we are still not up with XI so I am trying to load XML to BW delta queue.  The question still remains, how do I make make the XML file (on my desktop say) point to the BW so the InfoPackage picks up and places in the delta queue?  Even if I had XI, there has to be a way whereby BW looks for the XML file.  That is what I want to know and stuck at.
    Any detailed step by step help will be appreciated as always.
    Cheers

Maybe you are looking for

  • Regarding Performance It is Urgent.

    hi      I have one statement    move-corresponding gt_bkpf to post_tab. In gt_bkpf  Internal Table 10 fields are there. Post_tab is another Internal Table. In performance issue you need to use ASSIGN instead of move-corresponding. How can i do it. Pl

  • Can't figure out how to shuffle albums

    In Settings I go to "shuffle" and select "albums", but then when I exit Settings and go to "shuffle songs", it continues to go from one random song to another, and not from album to album. What am I doing wrong? Kip

  • Error by patching of SAP NetWeaver with Oracle on Windows

    Hi! I am about to patch my SAP system (SAP NetWeaver 04S) with Oracle on Windows. The following error occurs: Import phase 'CHECK_REQUIREMENTS' (05.02.2008, 16:00:39) Error during executing the tp command 'tp CONNECT B11   ...' tp return code: '0232'

  • Hierarchy ALV and LinkToURL and row colors

    Hi! I've to implement a hierarchy ALV with two hierarchy columns, which should appear as LinktoURL (different URLs). The Hierarchy-header-line should be displayed in an other color then the other rows. Popins are not supported by ALV? This could help

  • Programmatically save xls file as pdf

    Using Microsoft Report Generation Toolkit to create report. Client wants pdf file not xls file. Suggestions for programmatically saving xls file as pdf. Solved! Go to Solution.