SQLLDR script to load .xls file to database.
Hello Experts,
Please can anyone tell me the sqlldr script to load .xls file to the database.
I am using Oracle 10g XE as the database, and want to load a .xls file to a schema using the sqlldr script.
Waiting for your reply...
Thanks in advance,
Manoj Indalkar.
Hello Manu,
that's what heterogeneous services are made for. With these you can select from XLS files.
Re: Read CSV/XLS file to insert into Oracle database.
or
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4406709207206
http://jiri.wordpress.com/2010/01/21/load-ms-excel-file-to-oracle-database/
Regards
Marcus
Similar Messages
-
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 -
Urgent: Does dbms_java package is required to load jar file into database?
Hi, It's a urgent request. I am trying to install jar file that was created by JDeveloper into database using loadjava. But it is giving so many errors.
Do we need to install dbms_java package in order to load jar files into the database? Thanks.Thanks for your reply Kamal.
I am trying to load these jar files into Oracle 9.2.0.3.20 database.
Could you please give me the list of the steps to enable java within the database? Thanks. -
"Memory effect" when loading .xls file information using PropertyLoader
I have a TestStand 3.1 application, in which the sequence start off loading a number of configuration settings embedded in different .xls files using the PropertyLoader.
Unfortunately, Teststand sometimes loads the previously used .xls files (same name, located elsewhere), rather than those it were supposed to. In particular, if a .xls file is missing, Teststand will often (always?) load a previously used file with the same name, but located elsewhere. VERY inconvinient when testing ...!
Is there any way to remove this unfortunate "memory effect"?Where are your sequence files located? If the .xls files are relative to them you might want to use a more fully specified relative path to the files (for example: bin\config\filename.xls) rather than just filename.xls. Then becareful to remove search directories (especially recursive ones) that you might have added to find these files. It's very easy to get into problems with recursive search directories or by adding too many search directories if you have lots of files with the same names, by instead using paths relative to the sequence file you can avoid the need to add search directories in many cases.
Hope this helps,
-Doug -
Qustion in loading XML File to database
hi:
I have a XML File. In this file there is an outside entity . The definition like following:
<?Pub Doctype public="" system="PurchaseOrder.dtd"?>
<!DOCTYPE PurchaseOrder [
<!ENTITY % graphics SYSTEM "PurchaseOrder.SGE">
%graphics;
]>
<?Pub Inc?>
when I uploaded this file into database I got an error message
INSERT INTO PurchaseOrder VALUES(XMLTYPE(getDocument('2002060001.XML')));
ORA-31011:XML parse fail
ORA-19202:XML proccess
LPX-00202:could not open file "PurchaseOrder.SGE" Error at line 6
I placed the file (2002060001.XML and PurchaseOrder.SGE) in the same folder.
How can I solve this problem ?9.2.0.1 does not support references to DTD as files. We are hoping to fix this in 9.2.0.2 patch. In the mean time you could try putting the DTD in a know XDB Directory (in the example below (/public/dtdirectoryP) and changing the DTD refernece to an HTTP reference to local host on 8080...
eg http://localhost:8080/public/dtddirectory/...
This might work...
Note that as far as I am aware XML DB will not validate against the DTD, nor will it entity references etc from the DTD... -
Looping in Maxl Script - To load multiple files
Hi,
I am using Essbase 11.1.2 on UNIX.
I have maxl script which will load 20 to 30 extraction file. Number is inconsistent. Extraction files will grow each month. Extraction files are with same name with the suffix _1,_2...(2 Gb thing). My previous script was hard coded to load file by file to load up to 50 files. I am trying to remove these hard coded lines, and try to loop the “load” statement. I have tried several ways using while loop in shell to call maxl /msh , but no luck. Any ideas?
ThanksA very similar question was asked recently (but for Windows): Re: Maxl to import datafolders
What have you tried? Maybe someone here can show you what's wrong with your script.
The approach I usually take with this type of problem is to write a script that dynamically builds one single MaxL script with the appropriate number of files, rather than calling MaxL multiple times.
I am generally too ashamed to share my Unix scripts, but at it's most basic, non-error-trapped, probably-inadvisable-and-full-of-holes-for-all-kinds-of-reasons, you could include something like this to build your load script:
ls filename*.txt | awk {'print "import database etc... "$1" ...on error etc;"'} > scriptname.mshSince you can nest MaxL scripts, you can then reference scriptname.msh from a static 'master' script which handles login / spool on / spool off / logout as appropriate. See http://download.oracle.com/docs/cd/E17236_01/epm.1112/esb_tech_ref/maxl_commands_nesting.html or Cameron's 2009 K'scope presentation: http://odtug.com/apex/f?p=500:575:526121996615242::NO::P575_CONTENT_ID:4605 -
How to debug this error? trying to load excel file to Database
SSIS package "c:\users\asubedi\documents\visual studio 2012\Projects\Integration Services Project1\Integration Services Project1\PackageToLoadBuyerDedupe.dtsx" starting.
Information: 0x4004300A at BuyerDedupe, SSIS.Pipeline: Validation phase is beginning.
Error: 0xC0209303 at PackageToLoadBuyerDedupe, Connection manager "Excel Connection Manager": The requested OLE DB provider Microsoft.ACE.OLEDB.12.0 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.
An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".
Error: 0xC001002B at PackageToLoadBuyerDedupe, Connection manager "Excel Connection Manager": The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=219816
Error: 0xC020801C at BuyerDedupe, Excel Source [2]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Error: 0xC0047017 at BuyerDedupe, SSIS.Pipeline: Excel Source failed validation and returned error code 0xC020801C.
Error: 0xC004700C at BuyerDedupe, SSIS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at BuyerDedupe: There were errors during task validation.
SSIS package "c:\users\asubedi\documents\visual studio 2012\Projects\Integration Services Project1\Integration Services Project1\PackageToLoadBuyerDedupe.dtsx" finished: Failure.
how to debug this issue?Hi Arjunji,
The issue occurs because you have only 32-bit Microsoft ACE 12.0 OLEDB drivers installed, however, the package runs in 64-bit runtime mode which requires 64-bit drivers.
To avoid this issue, you need to either install the 64-bit
Microsoft Access Database Engine 2010 Redistributable or run the package in 32-bit runtime mode. To run the package in 32-bit runtime mode, in SSDT, you can set the Run64BitRuntime property of the IS project to False; in a SQL Server Agent job, you can
configure the SSIS Package Job step and check the “Use 32 bit run time” option.
In addition, please note that the 32-bit install file of Microsoft Access Database Engine 2010 Redistributable and the 64-bit one cannot be installed side by side on a single server. However, if your current ACE 12.0 OLE DB drivers are installed by 32-bit
Office suit, you can go ahead and install the 64-bit Microsoft Access Database Engine 2010 Redistributable.
Regards,
Mike Yin
TechNet Community Support -
Loading ASCII files - too slow
I have script for loading ASCII file into database.
First I use SQL loader to load data into temporary tables. After
that I start procedure which does some linking of loaded data
which is nessesary.
After that I move data from temp tables to main tables.
There are 7 main tables, two of them have 30,000,000 rows, other
are smaller. Tablespace has 12 Gb, and it is localy managed.
Problem is, that few days ago load of one ASCII file with 10,000
rows took 10 seconds to finish, but now it takes 90 seconds.
Problem is not SQL loader, but procedure for linking and coping.
But why it is so slow now?
Nothing is changed, we started a large load (some 6000 ASCII
files). When we started it was fast (10 sec/file), now it's slow
(90 sec/file).
I also noticed that database process uses 40% of CPU. When it
was working fine it took 10-15 % of CPU time.
Also, when everithing was working fine used space in datafiles
was growing, but now it seams to be on same level al the time.
PCTFREE for tables is 10 and PCTUSED is 60.
Can anybody help, please?Is this CBO or RBO ? I am curious -- are you building stats
during data loads ? Might want to review your strategy either
way.
Are there any concurrent events happening on either the host or
the rdb during the most recent (slower) loads that might not
have been occuring before ? Eg: heavy queries against the tables
occuring during data load events ?
Is your 12g tablespace split over drives ? Can't help but wonder
what kind of fragmentation is occuring on these tables and
underlying storage ? 30,000,000 rows per tab is alot of rows.
If you are practicing datawarehouse forced reload (ETL) of the
tables then I would be inclined to truncate target tables first
(including storage) to allow Oracle to use some 'smarts' as it
re-allocated extents for your many millions of rows.
Generally speaking, update degradation such as you are
experiencing can be attributed to bottlenecks in TBSs and
datafiles that are choking from write activity. I have resolved
similar issues through partitioning and truncating.
Hope this helps, RP.
I have script for loading ASCII file into database.
First I use SQL loader to load data into temporary tables. After
that I start procedure which does some linking of loaded data
which is nessesary.
After that I move data from temp tables to main tables.
There are 7 main tables, two of them have 30,000,000 rows, other
are smaller. Tablespace has 12 Gb, and it is localy managed.
Problem is, that few days ago load of one ASCII file with 10,000
rows took 10 seconds to finish, but now it takes 90 seconds.
Problem is not SQL loader, but procedure for linking and coping.
But why it is so slow now?
Nothing is changed, we started a large load (some 6000 ASCII
files). When we started it was fast (10 sec/file), now it's slow
(90 sec/file).
I also noticed that database process uses 40% of CPU. When it
was working fine it took 10-15 % of CPU time.
Also, when everithing was working fine used space in datafiles
was growing, but now it seams to be on same level al the time.
PCTFREE for tables is 10 and PCTUSED is 60.
Can anybody help, please? -
BAPI - DATA TRANSFER FROM .XLS FILE TO DB TABLE
I am upload data from xls file to database table.
first i have load xls file data to internal table (it_data) that is working.
then from internal table to database table (zskv_rate) by function module (ZBAPI_RATE_SAVEDATA) which is not working.
ex.
LOOP AT IT_DATA.
Header
ZSKV_RATE-DIVN = IT_DATA-DIVN.
ZSKV_RATE-REGN = IT_DATA-REGN.
ZSKV_RATE-PLANT = IT_DATA-PLANT.
ZSKV_RATE-RATE = IT_DATA-RATE.
APPEND IT_DATA.
CALL FUNCTION 'ZBAPI_RATE_SAVEDATA'
EXPORTING
HEADDATA = ZSKV_RATE
IMPORTING
RETURN = BAPI_RETURN
TABLES
DATA = IT_DATA
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,IT_DATA-DIVN.
ELSEIF BAPI_RETURN-TYPE = 'S'.
WRITE: 'Successfully created material' ,IT_DATA-DIVN.
ELSE.
WRITE:/ 'NONE' ,IT_DATA-DIVN.
ENDIF.
ENDLOOP.
how to transfer data from internal table to database table.Hi Sanjeev,
as u hv uploaded the excel file into the internal table,
u can update the ztable from internal table..
modify <dbtab>from itab.
regards.
Mdi.Deeba -
Help needed in reading text file to database table
Hello experts,
i have to insert the values from the column of this text file and insert them in my database table.
I have done a few file to table insertions but i'm having some trouble with this one.
Any suggestions plz
thanks
liab_report 1.00 Page: 1
CDC:00537 / Mon Jun-21-2010 LIABILITY REPORT Mon Jun-21-2010 22:06:26
DRAW 1; SET 1; November 7, 2009
TOTAL PAID ON TOTAL EXPIRED ON TOTAL FRAC OUTSTANDING
WINNERS 06/21/10 PAID 06/21/10 EXPIRED ROUND
DIVISION AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT
Div1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Div2 701040.00 0.00 660146.00 0.00 40894.00 0.00 0.00
Div3 1444128.00 0.00 1330056.00 0.00 114072.00 0.00 0.00
Div4 4711900.00 0.00 3889700.00 0.00 822200.00 0.00 0.00
6857068.00 0.00 5879902.00 0.00 977166.00 0.00 0.00
DRAW 2; SET 1; November 14, 2009
TOTAL PAID ON TOTAL EXPIRED ON TOTAL FRAC OUTSTANDING
WINNERS 06/21/10 PAID 06/21/10 EXPIRED ROUND
DIVISION AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT
Div1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Div2 817817.00 0.00 817817.00 0.00 0.00 0.00 0.00
Div3 1687405.00 0.00 1611742.00 0.00 75663.00 0.00 0.00
Div4 3402100.00 0.00 3034200.00 0.00 367900.00 0.00 0.00
5907322.00 0.00 5463759.00 0.00 443563.00 0.00 0.00
DRAW 3; SET 1; November 21, 2009
TOTAL PAID ON TOTAL EXPIRED ON TOTAL FRAC OUTSTANDING
WINNERS 06/21/10 PAID 06/21/10 EXPIRED ROUND
DIVISION AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT
Div1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Div2 779933.00 0.00 769804.00 0.00 10129.00 0.00 0.00
Div3 1605548.00 0.00 1525104.00 0.00 80444.00 0.00 0.00
Div4 4891700.00 0.00 4256800.00 0.00 634000.00 0.00 900.00
7277181.00 0.00 6551708.00 0.00 724573.00 0.00 900.00Plz clarify whether u want to load text file as a file into database or value of this text file into database. If values are to be loaded from this text file, U can better format the text file and use SQL loader to load the file into database. By formatting the database, i mean remove the unnecessary headings and characters, kee only the values to be loaded idelimited by ' '(space) or ','(comma). Create a control file and load it into the target table.
-
Hi All,
I have an application on WL8.1 with sp3, the database is SQL Server 2000. I have code below to load local file into database. The data type in database is image.
PreparedStatement pStatement = null;
InputStreammyStream myStream = new InputStream();
myStream.setEmbeddedStream( is );
pStatement.setBinaryStream( 1, myStream, -1 );
pStatement.executeUpdate();
pStatement.close();
pStatement = null;
is is InputStream from a local file and the sql statement is
insert into file_content(content) values(?)
This workes fine for the files with size less than 150M, but for those big files (>150M), it doesn't work and I got error message as below:
<Feb 11, 2005 12:00:41 PM PST> <Notice> <EJB> <BEA-010014> <Error occurred while attempting to rollback transaction: javax.transaction.SystemException: Heuristic hazard: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: [BEA][SQLServer JDBC Driver]Object has been closed.))
javax.transaction.SystemException: Heuristic hazard: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: [BEA][SQLServer JDBC Driver]Object has been closed.))
at weblogic.transaction.internal.ServerTransactionImpl.internalRollback(ServerTransactionImpl.java:396)
at weblogic.transaction.internal.ServerTransactionImpl.rollback(ServerTransactionImpl.java:362)
Any body can help? Thanks in advance.Fred Wang wrote:
Hi All,
I have an application on WL8.1 with sp3, the database is SQL Server 2000. I have code below to load local file into database. The data type in database is image.
PreparedStatement pStatement = null;
InputStreammyStream myStream = new InputStream();
myStream.setEmbeddedStream( is );
pStatement.setBinaryStream( 1, myStream, -1 );
pStatement.executeUpdate();
pStatement.close();
pStatement = null;
is is InputStream from a local file and the sql statement is
insert into file_content(content) values(?)
This workes fine for the files with size less than 150M, but for those big files (>150M), it doesn't work and I got error message as below:
<Feb 11, 2005 12:00:41 PM PST> <Notice> <EJB> <BEA-010014> <Error occurred while attempting to rollback transaction: javax.transaction.SystemException: Heuristic hazard: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: [BEA][SQLServer JDBC Driver]Object has been closed.))
javax.transaction.SystemException: Heuristic hazard: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: [BEA][SQLServer JDBC Driver]Object has been closed.))
at weblogic.transaction.internal.ServerTransactionImpl.internalRollback(ServerTransactionImpl.java:396)
at weblogic.transaction.internal.ServerTransactionImpl.rollback(ServerTransactionImpl.java:362)
Any body can help? Thanks in advance.I already answered this as to the cause, in the ms newsgroups... It's the DBMS choking so
bad on the size of your image file that it actually kills the connection. Note that the DBMS
has to save the whole image to log as well as to the DBMS table. The fundamental response is
to get DBA help to configure the DBMS to be able to do what you want. If you want and can,
you could split your image column into multiple image columns, and split your data into
100meg chunks, and then enter an empty row and then update it column by column, and then
concatenate the data again in the cleint when you get it out, etc, but much better to post
to the MS server newsgroups for ideas.
Joe -
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 -
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 -
WSAD : loading properties file from EBJ project
Hi,
I am trying to load properties file contains database parameters into my EJB project. I am using WSAD as IDE tool
can you please help me with following.
1. where to place the .properties file physically ?
2.how to load the file to my EJB/DAO classes
3.can i use the same location to place log4j.properties file as well ?
I have tried doing in different ways but none is working.
thank you
Narendragot it working , for information pl go to the following page and section "Using log4j in an EJB Application"
i have followd same steps for loading my properties file .
http://sys-con.com/story/?storyid=43413&DE=1 -
Flash actionscript loads jpg files, no png or gif
Hi, I'm using this script to load png files, but it does not
load them, it loads jpgs. It is being pulled from an xml file. I
have also tried gifs and that does not work. I need to put images
that have transparency. I can not find any refrence to jpg in the
code or anything like that. Any ideas would be helpful.
code:
Thanks,
JoshHi, I'm using this script to load png files, but it does not
load them, it loads jpgs. It is being pulled from an xml file. I
have also tried gifs and that does not work. I need to put images
that have transparency. I can not find any refrence to jpg in the
code or anything like that. Any ideas would be helpful.
code:
Thanks,
Josh
Maybe you are looking for
-
White screen appears when using AS3 wrapper file with Captivate 7
We had no problems with this in the past but now a white screen appears instead of the captivate running. The file is used when we use Captivate, streaming video, or HTML assessment. It triggers a complete signal to our LMS at the end. Is there anyth
-
OBIEE content cannot be displayed in the IFrame
Hi, After embedding OBIEE 11.1.1.6.0 into EPM 11.1.2.1 EPM System Workspace ,i am getting below message ,while navigating through different dashboards (I have several tab's/pages under one dashboard and several dashboard links are present under each
-
I have a table called 'test' with about 10 fields. One field is called acty_type and I also have a field called type_check. What I want to do is look at each record and if the acty_type field is blank then I want to put a 1 in the type_check field. I
-
I'm using smart update util to upgrade my 10.3.1 weblogic installation. In Oracle Smart Update util I selecte Maintenance Packs->Update and it bring up a BEA Smart Update application which finds 10.3.3.0 as the upgrade option. After selecting this op
-
Terminal, Preview and App Store won't start? Please help
Yesterday after installing "Clean up my Mac" software, I have noticed that Preview doesn't work anymore. At the same time "Command Line Developer Tools for OS X Mavericks" was installed. Today I also noticed that Terminal and App Store won't work. Ho