Loading xml file of 1GB in a oracle table
Could any one help me out , how can i load a xml file of large size in a oracle table
using pl/sql developer.
Thanks
Hi,
I am also trying to process large XML file but getting the following error. The code works fine if the smaller size file. Could you please help me how can I process and upload the XML file of more than 10MB size into an oracle table. The table structure does not match at all to the xml tags. I am trying with the following code.
ERROR at line 1:
ORA-04031: unable to allocate 2520 bytes of shared memory ("large
pool","unknown object","session heap","koh-kghu session heap")
ORA-06512: at "VMI_USER.PKG_VMI_FILE_UPLOAD", line 978
ORA-04031: unable to allocate 1000 bytes of shared memory ("large
pool","unknown object","qmxlu subheap","qmemNextBuf:alloc")
ORA-06512: at line 1
I am using Oracle 10g and having the following method to process the xml file to upload it's contents in the database table conditionally:
PROCEDURE pr_process_xml_file(pin_xml_file_name IN VARCHAR2)
IS
l_bfile BFILE;
l_clob CLOB;
l_parser dbms_xmlparser.parser;
l_doc dbms_xmldom.domdocument;
l_nl dbms_xmldom.domnodelist;
l_n dbms_xmldom.domnode;
l_nl_party dbms_xmldom.domnodelist;
l_n_party dbms_xmldom.domnode;
l_nl_nad dbms_xmldom.domnodelist;
l_n_nad dbms_xmldom.domnode;
l_nl_line dbms_xmldom.domnodelist;
l_n_line dbms_xmldom.domnode;
begin
-- the xml file to process
l_bfile := BFileName('DATA_DIR',pin_xml_file_name);
-- Create temporary lob
dbms_lob.createtemporary(l_clob, cache=>FALSE);
-- open xml file in readonly mode
dbms_lob.OPEN(l_bfile, dbms_lob.lob_readonly);
-- load the file contents in the clob
dbms_lob.loadfromfile(l_clob,l_bfile,dbms_lob.getlength(l_bfile));
-- close the xml file
dbms_lob.CLOSE(l_bfile);
-- create a parser
l_parser := dbms_xmlparser.newparser;
-- parse the document and create a new DOM document
dbms_xmlparser.parseclob(l_parser,l_clob);
l_doc := dbms_xmlparser.getdocument(l_parser);
-- free resources associated with the parser now it is no longer required
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeparser(l_parser);
-- get a list of all the DOCUMENT nodes in the document using the XPATH systax
l_nl := xslprocessor.selectnodes(xmldom.makenode(l_doc),'/TRADING/DOCUMENT');
-- loop thru the list and create a DOCUMENT record
FOR cur_doc IN 0 .. xmldom.getlength(l_nl) - 1
LOOP
.. here I process the contents of file tag by tag and load them in the stagging table first
END LOOP;
.. Here I load the data from stagging table to target oracle table.
xmldom.freedocument(l_doc);
end;
This works fine if the size of the xml file is smaller like 1-2 MB but not for large file.
Please help.
Thanks - Pawan
Similar Messages
-
Need to store multiple xml files as each record in oracle table
Hi All,
I have a set of XML files (say 20 xml files). I need to store the enitire content of each file as a string into the oracle table.
Do we have any PL/SQL procedures which will do this job. I will pass the path of the directory to the procedure, so that it takes all the xml files and store it in the table.
After that i need to remove some tags of the xml. so it will be better if we store records as a string rather than of xmltype.
Please help in achieving this.
Thanks in Advance,
Ram Mohan THi Gyanchand,
I have wrote an article BizTalk Server 2010: Grouping
and Debatching/Splitting Inbound Messages (TypedPolled) from WCF-SQL Adapter which is for SQL, but yes same can be done with Oracle.
If grouping is not required then, you can overlook it and apply debatching only.
Maheshkumar
S Tiwari|User
Page|Blog|BizTalk
Server: Multiple XML files to Single FlatFile Using File Adapter -
Load xml file data in oracle 9i table
Hi,
I have oracle 9i R2 (9.2.0.8) and currently i am loading data using sql*loader as i am getting text file. I will be getting file in XML format shortly.
I would like tp know if there is a sql*loader way to load xml file or another easy method that i can use it?
If you can provide me very simplest way, i will really appreciate it.
Thanks,Please refer
http://download-uk.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb25loa.htm -
Loading XML files in Oracle via SQL*Loader
Hello,
I need to load the data in an XML file provided by a thrird party into my Oracle DB. This file is not formatted as per the requirements of XSU, so I need to find an alternative. In the online documentation for Oracle8i it is stated that one way to load XML files into Oacle is via SQL*Loader. On the SQL*Loader documentation this is not mentioned. Also as far as I know, SQL*Loader can be used with delimited fields or fixed length fields and thus I do not see how this can be done (but it would be very cool).
Can you give me any advice on this?
Thanks
Ciao
FerruccioNo, SQL*Loader cannot process DBF files directly
Tom Kyte provides a package to read in DBF files thorugh utl_file
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:711825134415 -
Loading XML File into Oracle 10G XE
I am trying to load an XML file into 10G XE from the Utilities interface, I have created a Table to load into but when I try to load I get the following cryptic error "XML Load Error". There is no other information, can someone give me some insight where to start to resolve this problem?
The error messages when importing fails provided by APEX 2.1 are not very useful as they do not provide any clue...
If possible, you can try to load XML file with SQL*Loader - probably you will get then more useful error messages. -
Error while loading xml files using JDBC
Hi,
I am trying to load xml files into an xmltype table using JDBC calls and am getting this error for some files
LPX-00200: could not convert from encoding UTF-8 to UCS2
The xml files and our database are both UTF-8 encoded. The version of oracle that we have here is 9.2.0.6
Any suggestions in this matter will be greatly appreciated.
Thanks,
UmaI also experienced this problem and unfortunately this solution didn't work for me given that the tag you suggested was already on the XML file.
-
Error while loading XML files into scott user
Hi All,
I'm new to xml files. I need to load xml files into database through OWB.
I have xml file in my local machine & am trying to load into table PO of Scott. Scott is registered as repository user.
Followed same steps as specified in userguide.
But, when executing the procedure ( in two ways one as just table name, and other as user.table name) it is showing the below error:
Procedure is:(1)--with username.tablename
begin
wb_xml_load(
'<OWBXMLRuntime>'||
'<XMLSource>'||
'<file>&&SAMPLES_DIR.sample1.xml</file>'||
'</XMLSource>'||
'<targets>'||
'<target dateFormat="yyyy.MM.dd">scott.PO</target>'||
'</targets>'||
'</OWBXMLRuntime>'
end;
ERROR at line 1:
ORA-20006: Error occurred while truncating target database object SCOTT.PO.
Base exception: ORA-01031: insufficient privileges
ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
ORA-06512: at "SCOTT.SAMPLE1", line 3
ORA-06512: at line 1
Procedure is:(2) with out username
begin
wb_xml_load(
'<OWBXMLRuntime>'||
'<XMLSource>'||
'<file>&&SAMPLES_DIR.sample1.xml</file>'||
'</XMLSource>'||
'<targets>'||
'<target dateFormat="yyyy.MM.dd">PO</target>'||
'</targets>'||
'</OWBXMLRuntime>'
end;
ERROR at line 1:
ORA-20006: Error occurred while truncating target database object PO.
Base exception: ORA-00942: table or view does not exist
ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
ORA-06512: at line 2
xml file:
<ROWSET>
<ROW>
<ID>100</ID>
<ORDER_DATE>2000.12.20</ORDER_DATE>
<SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
<SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
<SHIPTO_CITY>Redwood City</SHIPTO_CITY>
<SHIPTO_STATE>CA</SHIPTO_STATE>
<SHIPTO_ZIP>94065</SHIPTO_ZIP>
</ROW>
</ROWSET>
Note: Everything works fine if I create PO table in OWBSYS user and execute the procedurein OWBSYS user. OWBSYS.PO table will be loaded.
What privileges are missing, what shouldI do if I want to execute the procedure from scott user and load the table of scott.
Thanks in advance for the help.
Regards,
JoshnaHi Joshna,
Please follow below steps to load xml file to oracle database.
1.First connect to owb (Design Center) through your repository owner user (ex : REP_OWNER).
2. Import WB_XML_LOAD procedure . and exit to repository owner.
3. connect to owb design center through your repository user (ex : REP_USER)
Create New mapping and drag one Constant Operator and create one attribute, paste / edit following code
'<OWBXMLRuntime>'||
'<XMLSource>'||
'<file>E:\SOURCE\emp.xml</file>'||
'</XMLSource>'||
'<targets>'||
'<target truncateFirst = "FALSE" dateFormat="yyyy.MM.dd">rep_user.emp</target>'||
'</targets>'||
'</OWBXMLRuntime>'
4. Drag pre mapping operator and select WB_XML_LOAD procedure
5. Connect Constant Operator attribute to pre mapping operator.
6. Drag two dummy tables and connect source to target. (ex : drag t1 (table) tab two times and connect.
7. Validate and deploy the mapping.
8. grant necessary grant command to rep_owner user to rep_user user.
(Note : target truncateFirst = "FALSE" by default truncate the table. So you have to give grant privileges
To rep_user , select ,insert, delete privileges.
9. Execute the mapping , and check EMP table. (Note : before loading EMP table delete all records ).
10 . If you want more description please go through the below link
http://download.oracle.com/docs/html/A95931_01/apf.htm
Regards
Venkat -
Using sqlldr to load XML files and the file name ? or access the file name
I can use sqlldr to load the XML files when I declare the target table of XMLTYPE, but I need to load the filename and a sequence also with the XML in a table so we can mark wether the file passed validation or not.
something like ....
Create table test1
lobfn varchar(200),
load_number number,
XML_COL XMLTYPE
--------------- here is my sqlldr command
sqlldr xml_user/xml_user load_test1.ctl
LOAD DATA
INFILE *
INTO TABLE test1
append
xmltype(XML_COL)
lobfn FILLER char TERMINATED by ',',
XML_COL LOBFILE(lobfn) TERMINATED BY EOF
BEGINDATA
filename1.xml
filename2.xml
filename64.xml
sqlldr comes back and says "commit point reached - logical record count 64
but when I select count(*) from test1; it returns 0 rows.
and when I
SELECT X.* FROM tst1 P2,
XMLTable ( '//XMLRoot//APPLICATION'
PASSING P2.XML_COL
COLUMNS
"LASTNAME" CHAR(31) PATH 'LASTNAME',
"FIRSTNAME" CHAR(31) PATH 'FIRSTNAME'
) AS X;
It tells me invalid identifier ,
Do I need to use a function to get the XML_COL as a object_value ???
But when I create the table like
create table test1 of XMLTYPE;
and use sqlldr it works, but I dont have the file name, or dont know how to access it ??
and I can use
SELECT X.* FROM tst1 P2,
XMLTable ( '//XMLRoot//APPLICATION'
PASSING P2.object_value
COLUMNS
"LASTNAME" CHAR(31) PATH 'LASTNAME',
"FIRSTNAME" CHAR(31) PATH 'FIRSTNAME'
) AS X;BTW
Here's a trivial example of what you appear to be trying to do..
C:\xdb\otn\sqlLoader>sqlplus scott/tiger @createTable
SQL*Plus: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:10 2006
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> DROP TABLE TEST_TABLE
2 /
Table dropped.
SQL> CREATE TABLE TEST_TABLE
2 (
3 filename VARCHAR2(32),
4 file_content xmltype
5 )
6 /
Table created.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
C:\xdb\otn\sqlLoader>type sqlldr.ctl
LOAD DATA
INFILE 'filelist.txt'
INTO TABLE TEST_TABLE
FIELDS TERMINATED BY ','
FILENAME CHAR(32),
FILE_CONTENT LOBFILE(FILENAME) TERMINATED BY EOF
C:\xdb\otn\sqlLoader>type filelist.txt
testcase1.xml
testcase2.xml
C:\xdb\otn\sqlLoader>type testcase1.xml
<foo/>
C:\xdb\otn\sqlLoader>type testcase1.xml
<foo/>
C:\xdb\otn\sqlLoader>sqlldr userid=SCOTT/TIGER control=sqlldr.ctl log=sqlldr.log -direct
SQL*Loader: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:11 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Load completed - logical record count 2.
C:\xdb\otn\sqlLoader>sqlplus scott/tiger
SQL*Plus: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:18 2006
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from TEST_TABLE
2 /
FILENAME
FILE_CONTENT
testcase1.xml
<foo/>
testcase2.xml
<baa/>
SQL>
If you are interested in the 11g beta program please contact me directory at
markDOTdrakeAToracleDOTcom -
How to load XML files ? HELP!
Hi folks.
We have an old Oracle database 7.3..
So we need to load XML files into its tables.
As we understand Oracle Loader doesn't help us.
Is the way to load that files?
Thanks in advance
AlexI know you realize 7.3 is old but this is sort of like trying trying to view a DVD when you only have a VCR. Simple answer would be buy a DVD player, i.e. upgrade to a more recent version of Oracle where you will get many features to handle XML.
How do you want the XML loaded, all as a single object? That could be a CLOB column if 7.3 had them, I am not sure. You would probably have to write PL/SQL and something with UTL_FILE (if 7.3 had that) to load it.
If you want to put it multiple columns based on its tags, you would be better off parsing it using PERL (or something) into a CSV and loading that in SQL*Loader.
I assume as this is using XML it is a reasonably recent design, combining that with an ancient version of the database is just going to lead to endless headaches. -
Hi Gurus,
I am new to owb and as per requirement we need to load xml files into oracle table using owb.
below is the xml file:
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
please help me in loading above xml file using owb.You can leverage the XML SQL functions to extract from XML using the database, see the blog post below;
https://blogs.oracle.com/warehousebuilder/entry/leveraging_xdb
For example to extract information from your XML document the following SQL can be generated from OWB;
select extractValue(value(s), '/book/author'),
extractValue(value(s), '/book/year'),
extractValue(value(s), '/book/price') from
( select XMLType('<bookstore>
+<book category="COOKING">+
+<title lang="en">Everyday Italian</title>+
+<author>Giada De Laurentiis</author>+
+<year>2005</year>+
+<price>30.00</price>+
+</book>+
+<book category="CHILDREN">+
+<title lang="en">Harry Potter</title>+
+<author>J K. Rowling</author>+
+<year>2005</year>+
+<price>29.99</price>+
+</book>+
+<book category="WEB">+
+<title lang="en">Learning XML</title>+
+<author>Erik T. Ray</author>+
+<year>2003</year>+
+<price>39.95</price>+
+</book>+
+</bookstore>') adoc from dual+) r,
table(XMLSequence(extract(r.adoc, '/bookstore/book'))) s;
Cheers
David -
Loading XML file into DB Table
Hi
I m quite new to the loading XML file into database table.
It will be great if anyone could guide me to through.
Now,
i have an XML file which has to be loaded into the DB table.
what are the steps involved in doing this. How do i go from here ??
your help is greatly appriciated ???
Thank you so much!!
-ShashiOK - Although you really should read the XMLDB FAQ on this forum, here is some sample code of ONE of the ways of doing it
(there are multiple ways - and this is not the most simple one)
Based on Oracle 11gR1
-- sqlplus /nolog
clear screen
set termout on
set feed on
set lines 40
set long 10000000
set serveroutput on
set lines 100
set echo on
connect / as sysdba
col filename for a80
col xml for a80
-- Create schema “OTN”
drop user OTN cascade;
purge dba_recyclebin;
create user OTN identified by OTN;
grant dba, xdbadmin to OTN;
EXECUTE dbms_java.grant_permission( 'OTN', 'java.io.FilePermission','G:\OTN\xmlstore','read' );
prompt pause
pause
clear screen
-- Create directory
connect OTN/OTN;
show user
drop directory OTN_USE_CASE;
CREATE directory OTN_USE_CASE AS 'G:\OTN\xmlstore';
SELECT extract((XMLTYPE(bfilename('OTN_USE_CASE','ABANDA-20030407215829881GMT.xml'),NLS_CHARSET_ID('AL32UTF8'))),'*') AS "XML"
from dual;
prompt pause
pause
clear screen
-- Directory Listing - Tom Kyte
create global temporary table DIR_LIST
( filename varchar2(255) )
on commit delete rows
create or replace
and compile java source named "DirList"
as
import java.io.*;
import java.sql.*;
public class DirList
{public static void getList(String directory)
throws SQLException
{ File path = new File( directory );
String[] list = path.list();
String element;
for(int i = 0; i < list.length; i++)
{ element = list;
#sql { INSERT INTO DIR_LIST (FILENAME)
VALUES (:element) };
create or replace procedure get_dir_list( p_directory in varchar2 )
as language java
name 'DirList.getList( java.lang.String )';
prompt pause
pause
clear screen
-- The content of the global temporary table
exec get_dir_list( 'G:\OTN\xmlstore' );
select * from dir_list;
-- "COMMIT" will clear / truncate the global temporary table...
prompt pause
pause
clear screen
-- Combined: Reading XML content from multiple XML files
commit;
exec get_dir_list( 'G:\OTN\xmlstore' );
select * from dir_list where filename like '%.xml'
and rownum <= 10;
prompt pause
pause
clear screen
select extract((XMLTYPE(bfilename('OTN_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8'))),'*') AS "XML"
from dir_list dl
where dl.filename like '%.xml' and rownum <= 2;
prompt pause
pause
clear screen
-- If you can select it you can insert it...
-- drop table OTN_xml_store purge;
create table OTN_xml_store of xmltype
xmltype store as binary xml
commit;
exec get_dir_list( 'G:\OTN\xmlstore' );
set time on timing on
insert into OTN_xml_store
select XMLTYPE(bfilename('OTN_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) AS "XML"
from dir_list dl
where dl.filename like '%.xml';
set time off timing off
commit;
select count(*) from OTN_xml_store;
prompt pause
pause
clear screen
-- If you can select it you can create resources and files
set time on timing on
commit;
exec get_dir_list( 'G:\OTN\xmlstore' );
select count(*) from dir_list where filename like '%.xml';
set serveroutput on size 10000
DECLARE
XMLdoc XMLType;
res BOOLEAN;
v_foldername varchar2(4000) := '/public/OTN/';
cursor c1
is
select dl.filename FNAME
, XMLTYPE(bfilename('OTN_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) XMLCONTENT
from dir_list dl
where dl.filename like '%.xml'
and rownum <= 100;
BEGIN
-- Create XDB repository Folder
if (dbms_xdb.existsResource(v_foldername))
then
dbms_xdb.deleteResource(v_foldername,dbms_xdb.DELETE_RECURSIVE_FORCE);
end if;
res:=DBMS_XDB.createFolder(v_foldername);
-- Create XML files in the XDB Repository
for r1 in c1
loop
if (DBMS_XDB.CREATERESOURCE(v_foldername||r1.fname, r1.xmlcontent))
then
dbms_output.put_line(v_foldername||r1.fname);
null;
else
dbms_output.put_line('Loop Exception :'||sqlerrm);
end if;
end loop;
EXCEPTION WHEN OTHERS THEN
dbms_output.put_line('Others Exception: '||sqlerrm);
END;
set time off timing off
commit;
prompt pause
pause
clear screen
-- FTP and HTTP
clear screen
prompt
prompt *** FTP - Demo ***
prompt
prompt pause
pause
host ftp
-- open localhost 2100
-- user OTN OTN
-- cd public
-- cd OTN
-- ls
-- bye
clear screen
prompt
prompt *** Microsoft Internet Explorer - Demo ***
prompt
prompt pause
pause
host "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://OTN:OTN@localhost:8080/public/OTN/
prompt pause
pause
-- Accessing the XDB Repository content via Resource View
-- Selecting content from a resource via XBDUriType
clear screen
prompt set long 300
set long 300
prompt Relative Path - (path)
SELECT path(1) as filename
FROM RESOURCE_VIEW
WHERE under_path(RES, '/public/OTN', 1) = 1
and rownum <= 10
prompt pause
pause
clear screen
prompt Absolute Path - (any_path)
select xdburitype(any_path).getClob() as xml
FROM RESOURCE_VIEW
WHERE under_path(RES, '/public/OTN', 1) = 1
and rownum <= 1;
prompt pause
pause
-- CLEANUP ENVIRONMENT
clear screen
prompt
prompt >>>>> Clean UP !!! <<<<<<
prompt
prompt Cleanup environment and drop user...!!!
prompt
pause
clear screen
conn / as sysdba
alter session set current_schema=OTN;
begin
dbms_xdb.deleteResource('/public/OTN',dbms_xdb.DELETE_RECURSIVE_FORCE);
commit;
end;
alter session set current_schema=sys;
drop user OTN cascade;
Based on http://www.liberidu.com/blog/?p=1053 -
Hi.
My PL/SQL procedure loading xml files from oracle logical directory ("c:\temp") and inserting values into columns of the table. I use XSU with procedure:
create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
insCtx DBMS_XMLSave.ctxType;
rows number;
begin
insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
end;
For translate xml document to CLOB, I use :
CREATE OR REPLACE function getdocument(
p_directory in varchar2,
p_filename in varchar2)
return clob
is
l_bfile bfile;
l_clob clob;
begin
l_bfile := bfilename(p_directory, p_filename);
dbms_lob.open(l_bfile);
dbms_lob.createtemporary(l_clob, true, dbms_lob.session);
dbms_lob.loadfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile));
dbms_lob.close(l_bfile);
return l_clob;
end getdocument;
I didn't have problem with this procedures. But now i want load my xml files from another computer (i want use URL, not oracle logical directory).
How can i do it, using standart PL/SQL methods?Since you are parsing the XML what prevents you from delaying your requests for the image URL's? You can just as well add the image URL's to some kind of collection and load them after you have processed all the text content.
-
Loading XML files into an 8.0.6 database...
Hi,
I've got an Oracle 8.0.6 instance (Sun E250 Solaris 5.7) with multiple import data feeds. I am currently using SQL*Loader to load this data which are flat text delimited files. My data feeds will soon be supplying XML files instead of these flat files which is great, unfortunately, I will not be able to upgrade in 8.1.7 in time so that I can use the XML parser.
Is there anyway I can use SQL*Loader or some other tool to load XML files into my 8.0.6 database? If there is a way, could someone please send the information I would need to help perform this task?
Thanks for all your help...
Gerry D'Costa
Database Administrator
[email protected]
12Snap.comCheck out the Oracle XDB Developer's Guide, Chapter 3. There is an example of using BFileName function to load the xml files from a directory object created using create or replace directory. It works really well.
Ben -
Loading XML files using TCP/IP
Hi.
My PL/SQL procedure loading xml files from oracle logical directory ("c:\temp") and inserting values into columns of the table. I use XSU with procedure:
create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
insCtx DBMS_XMLSave.ctxType;
rows number;
begin
insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
end;
For translate xml document to CLOB, I use :
CREATE OR REPLACE function getdocument(
p_directory in varchar2,
p_filename in varchar2)
return clob
is
l_bfile bfile;
l_clob clob;
begin
l_bfile := bfilename(p_directory, p_filename);
dbms_lob.open(l_bfile);
dbms_lob.createtemporary(l_clob, true, dbms_lob.session);
dbms_lob.loadfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile));
dbms_lob.close(l_bfile);
return l_clob;
end getdocument;
I didn't have problem with this procedures. But now i want load my xml files from another computer (i want use TCP/IP, not oracle logical directory). Is it within the realm of possibility?
How can i do it, using standart PL/SQL methods?
P.S. Sorry my English.The UTL_TCP package should give you exactly what you want. See
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_tcp.htm -
Loading XML files into Database table
Loading XML files into Database table
Hi I have some XML files say 100 files in a virtual directory created using "Create or replace directory command" and those files need to be loaded into a table having a column of XMLTYPE. 1)How to load that using Oracle provided procedures/packagesCheck out the Oracle XDB Developer's Guide, Chapter 3. There is an example of using BFileName function to load the xml files from a directory object created using create or replace directory. It works really well.
Ben
Maybe you are looking for
-
Portal Forms are not getting displayed in the new oracle environment.
Hi All, The Forms in our Portal applications are not getting displayed after we have done the upgradation of Database in Unix from 8i to 9i. The reports are working fine.The forms that were added as portlets are not getting displayed and other forms
-
Error:-While assigning P.ordg to plant message is coming as assignment not
Hi, While assigning purchase org to plant the error message is coming as assignment is "Assignment is not possible for this object" any pointers for the same. Thanks, Dharmesh
-
Signature field in a pdf form is coming up as having a problem
When I open my secured pdf file, I am unable to change any information in my file because it is signed, I need to be able to clear my signature. At the top of the pdf file it says at least one signature has problems. Please fill out the following for
-
Lightroom and Photoshop scripts
Is there an easy way from lightroom to export a file to a photoshop script (e.g. xxx.jsx) such that the desired action in photshop can be scripted ? I know I can export to photoshop and edit, then run the script -- just wondering if this can be done
-
HT2513 How to use my Mac to manage "to do" lists?
MacBasics for iCal says that "New Reminder" is an option under "File". Not on my device, it's not! Is it possible to set up a categorized and date/time-connected "to do" list on my Mac? (without paying $50 for the "Things" app?) (I do not have anot