Loading XML file where data structure may vary
Hi guys,.
I'm trying to load a XML data file in an Oracle table, with some success, but it will fail to load certain lines when an element is missing. Here is an example of two rows of data:
<? XML version = "1.0" encoding = "utf-8"? >
< ReportDetails >
< ReportRequest >
< ExtractDate > 25/03/2010 < / ExtractDate >
< CaseNoReportRequest > 1234567 < / CaseNoReportRequest >
individual details < IndividualDetailsText > < / IndividualDetailsText >
< IndividualDetails >
< CaseNoIndividual > 1234567 < / CaseNoIndividual >
< title > < /title > MR
<>men < / Type >
Steve < FirstName > < / name >
< Name > test < / name >
Detail of < occupation > < / Occupation >
< / IndividualDetails >
Information about insolvency < CaseDetailsText > < / CaseDetailsText >
< CaseDetails >
< CaseNoCase > 1234567 < / CaseNoCase >
STEVE TEST < CaseName > < / CaseName >
Court of County of Preston < > < / Court >
Bankruptcy of < CaseType > < / CaseType >
< / CaseDetails >
< InsolvencyContactText > of insolvency services contact information < / InsolvencyContactText >
< InsolvencyContact >
< CaseNoContact > 1234567 < / CaseNoContact >
Blackpool < InsolvencyServiceOffice > < / InsolvencyServiceOffice >
Bureau of investigation < contact > < / Contact >
< / InsolvencyContact >
< / ReportRequest >
< ReportRequest >
< ExtractDate > 25/03/2010 < / ExtractDate >
< CaseNoReportRequest > 8901234 < / CaseNoReportRequest >
individual details < IndividualDetailsText > < / IndividualDetailsText >
< IndividualDetails >
< CaseNoIndividual > 8901234 < / CaseNoIndividual >
< title > < /title > MISS
Female < sex > < / Type >
Francesca < FirstName > < / name >
< Name > test < / name >
Clerk Administration < occupation > < / Occupation >
< / IndividualDetails >
< BankruptcyRestrictionsDetails >
< RestrictionsType > BANKRUPTCY RESTRICTIONS ORDER (BRO) < / RestrictionsType >
< RestrictionsStartDate > 19/07/2005 < / RestrictionsStartDate >
< RestrictionsEndDate > 19/07/2012 < / RestrictionsEndDate >
< / BankruptcyRestrictionsDetails >
Practitioner of the insolvency of < InsolvencyPractitionerText > contact information < / InsolvencyPractitionerText >
< IP >
< CaseNoIP > 8901234 < / CaseNoIP >
< MainIP > Kevin Morrison < / MainIP >
< /IP >
< InsolvencyContactText > of insolvency services contact information < / InsolvencyContactText >
< InsolvencyContact >
< CaseNoContact > 8901234 < / CaseNoContact >
Cardiff < InsolvencyServiceOffice > < / InsolvencyServiceOffice >
Bureau of investigation < contact > < / Contact >
< / InsolvencyContact >
< / ReportRequest >
< / ReportDetails >
It is the PL/SQL that I use to try to load it:
DECLARE
acct_doc XMLTYPE: = XMLTYPE (BFILENAME('FLA','data_file.xml'), NLS_CHARSET_ID ('AL32UTF8'));
BEGIN
INSERT INTO target_table)
extract_date,
case_no_report_request,
case_no_individual,
title,
gender,
first name,
family name,
occupation,
case_no_case,
case_name,
Court,
case_type,
case_no_contact,
insolvency_service_office,
contact
)
SELECT x1.extractdate,
x1.casenoreportrequest,
X2.casenoindividual,
X2.title,
x 2. Gender,
x 2. FirstName,
x 2. Surname,
X2.occupation,
x 3 .case_no_case,
x 3 .case_name,
X3.Court,
x 3 .case_type,
x 4 .case_no_contact,
x 4 .insolvency_service_office,
X4.contact
FROM XMLTABLE)
' / ReportDetails/ReportRequest.
PASSAGE acct_doc
COLUMNS header_no to ORDINALITE,
extractdate PATH VARCHAR2 (10) "ExtractDate."
casenoreportrequest NUMBER of path 'CaseNoReportRequest '.
) x 1,
XMLTABLE)
"$d/ReportDetails/ReportRequest [$hn] / ' IndividualDetails"
PASSAGE acct_doc "d."
x 1 .header_no LIKE "hn".
Casenoindividual COLUMN NUMBER PATH "CaseNoIndividual."
title VARCHAR2 (20) PATH "Title."
sex VARCHAR2 (20) PATH "Gender."
First name VARCHAR2 (30) PATH "First name",
name VARCHAR2 (30) PATH "name."
occupation VARCHAR2 (50) PATH "Profession".
) x 2,
XMLTABLE)
"$d/ReportDetails/ReportRequest [$hn] / ' CaseDetails"
PASSAGE acct_doc "d."
x 1 .header_no LIKE "hn".
Case_no_case COLUMN NUMBER PATH "CaseNoCase."
case_name PATH VARCHAR2 (50) "CaseName"
VARCHAR2 (40) path 'Court',
case_type PATH VARCHAR2 (40) "CaseType.
) x 3.
XMLTABLE)
"$d/ReportDetails/ReportRequest [$hn] / InsolvencyContact'"
PASSAGE acct_doc "d."
x 1 .header_no LIKE "hn".
Case_no_contact COLUMN NUMBER PATH "CaseNoContact."
insolvency_service_office PATH VARCHAR2 (20) "InsolvencyServiceOffice."
Contact PATH VARCHAR2 (30) "Contact".
) x 4;
COMMIT;
END;
The first row of the loads fine, but the second row is not at all responsible. I expected he would charge what information there but with NULL values for the missing "CaseDetails" element but it charge nothing at all. If I change the data and manually add it in an element 'CaseDetails', line load. Can someone explain to me how I can get all the lines to load even if some parts are missing?
Wrong approach altogether.
There is no need to join via a positional predicate in this case, just use a single query:
SQL> SELECT x.* 2 FROM XMLTABLE ( 3 '/ReportDetails/ReportRequest' 4 PASSING xmltype(bfilename('XML_DIR','data_file.xml'), nls_charset_id('AL32UTF8')) 5 COLUMNS extractdate VARCHAR2(10) PATH 'ExtractDate' 6 , casenoreportrequest NUMBER PATH 'CaseNoReportRequest' 7 , casenoindividual NUMBER PATH 'IndividualDetails/CaseNoIndividual' 8 , title VARCHAR2(20) PATH 'IndividualDetails/Title' 9 , gender VARCHAR2(20) PATH 'IndividualDetails/Gender' 10 , firstname VARCHAR2(30) PATH 'IndividualDetails/FirstName' 11 , surname VARCHAR2(30) PATH 'IndividualDetails/Surname' 12 , occupation VARCHAR2(50) PATH 'IndividualDetails/Occupation' 13 , case_no_case NUMBER PATH 'CaseDetails/CaseNoCase' 14 , case_name VARCHAR2(50) PATH 'CaseDetails/CaseName' 15 , court VARCHAR2(40) PATH 'CaseDetails/Court' 16 , case_type VARCHAR2(40) PATH 'CaseDetails/CaseType' 17 , case_no_contact NUMBER PATH 'InsolvencyContact/CaseNoContact' 18 , insolvency_service_office VARCHAR2(20) PATH 'InsolvencyContact/InsolvencyServiceOffice' 19 , contact VARCHAR2(30) PATH 'InsolvencyContact/Contact' 20 ) x ; EXTRACTDATE CASENOREPORTREQUEST CASENOINDIVIDUAL TITLE GENDER FIRSTNAME SURNAME OCCUPATION CASE_NO_CASE CASE_NAME COURT CASE_TYPE CASE_NO_CONTACT INSOLVENCY_SERVICE_OFFICE CONTACT ----------- ------------------- ---------------- -------- ---------- ------------- ---------- ----------------------- ------------ ------------ --------------------- ------------ --------------- ------------------------- --------------- 25/03/2010 1234567 1234567 MR Male Steve Test Retail 1234567 STEVE TEST Preston County Court Bankruptcy 1234567 Blackpool Enquiry Desk 25/03/2010 8901234 8901234 MISS Female Francesca Test Administration Clerk 8901234 Cardiff Enquiry Desk
Tags: Oracle Development
Similar Questions
-
How to load several files column data into essbase using the rule of load.
Hello
I need to load a file of data into essbase, which includes data from several columns.
Here is a sample file.
Year, Department, account, Jan, Feb, Mar, Apr, may, June, July, August, Sept, Oct, Nov, Dec
FY10, ministere1, account1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
FY10, agencies2, account1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
FY10, ministere3, account1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Thank you
SirotBut this isn't an error as such, that is to say that no data values have been changed so that they possible already exist in the database.
If there is no release, they should be in a file of errors.See you soon
John
http://John-Goodwin.blogspot.com/ -
File system data Structure of the ReFS in the context of a legal analysis?
Hello
Explain the file system data Structure of ReFS in the context of the legal analysis?
Concerning
Hello
Your question is beyond the scope of this community.
But I see you have already posted this Question on TechNet.
See you soon.
-
Error loading XML file in the column of XMLTYPE through SQL loader
Hi gurus,
I am trying to load the XML file into the column of XMLTYPE through SQL Loader but the errors themselves. Here are the details
Databases
The table structureSQL*Plus: Release 10.2.0.3.0 - Production on Tue Jul 24 17:17:55 2012 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Release 10.2.0.3.0 - 64bit Production BANNER ---------------------------------------------------------------- Oracle Database 10g Release 10.2.0.3.0 - 64bit Production PL/SQL Release 10.2.0.3.0 - Production CORE 10.2.0.3.0 Production TNS for Linux: Version 10.2.0.3.0 - Production NLSRTL Version 10.2.0.3.0 - Production
XML (simple.xml) fileCREATE TABLE TH_XML ( COL_ID_1 VARCHAR2(100 BYTE), IN_FILE_1 XMLTYPE ) XMLTYPE IN_FILE_1 STORE AS CLOB (TABLESPACE SMDAT)
Control file<?xml version="1.0"?> <catalog> <book id="bk101"> <author>Some Author1</author> <title>Some Title1</title> <genre>Computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>creating applications</description> </book> <book id="bk112"> <author>Some Author2</author> <title>Some Title2</title> <genre>Computer</genre> <price>49.95</price> <publish_date>2001-04-16</publish_date> <description>Microsoft Visual Studio 7 is explored in depth</description> </book> </catalog>
LOG fileLOAD DATA INFILE 'c:\simple.xml' APPEND INTO TABLE TH_XML XMLTYPE(in_file_1) ( col_id_1 filler CHAR (100), in_file_1 LOBFILE(CONSTANT "c:\simple.xml") TERMINATED BY EOF )
I get error ORA-00904: "SYS_NC_ROWINFO$": invalid identifier in the logfile (mentioned above). Could someone help me know where I am doing wrong?SQL*Loader: Release 10.2.0.3.0 - Production on Tue Jul 24 16:42:25 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. Control File: c:\my_file.ctl Data File: c:\simple.xml Bad File: c:\simple.bad Discard File: none specified (Allow all discards) Number to load: ALL Number to skip: 0 Errors allowed: 50 Bind array: 64 rows, maximum of 256000 bytes Continuation: none specified Path used: Conventional Table TH_XML, loaded from every logical record. Insert option in effect for this table: APPEND Column Name Position Len Term Encl Datatype ------------------------------ ---------- ----- ---- ---- --------------------- COL_ID_1 FIRST 100 CHARACTER (FILLER FIELD) IN_FILE_1 DERIVED * EOF CHARACTER Static LOBFILE. Filename is c:\simple.xml Record 1: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 2: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 3: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 4: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 5: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 6: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 7: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 8: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 9: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 10: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 11: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 12: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 13: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 14: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 15: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 16: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 17: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 18: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 19: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 20: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 21: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 22: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Record 23: Rejected - Error on table TH_XML. ORA-00904: "SYS_NC_ROWINFO$": invalid identifier Table TH_XML: 0 Rows successfully loaded. 23 Rows not loaded due to data errors. 0 Rows not loaded because all WHEN clauses were failed. 0 Rows not loaded because all fields were null. Space allocated for bind array: 256 bytes(64 rows) Read buffer bytes: 1048576 Total logical records skipped: 0 Total logical records read: 23 Total logical records rejected: 23 Total logical records discarded: 0 Run began on Tue Jul 24 16:42:25 2012 Run ended on Tue Jul 24 16:42:26 2012 Elapsed time was: 00:00:00.23 CPU time was: 00:00:00.05
Thanks in advance.
Published by: 876991 on 24 July 2012 14:18Hello
This remove the control file:
XMLTYPE(in_file_1)
It is used only if the target table is an array of XMLType object.
For an XMLType column LOBFILE is sufficient, for example:
LOAD DATA INFILE * APPEND INTO TABLE TH_XML ( col_id_1 CHAR (100), in_file_1 LOBFILE(CONSTANT "c:\simple.xml") TERMINATED BY EOF ) begindata MYID1
It tells SQL * Loader data consisting of one record with COL_ID_1 = "MYID1" and content = "c:\simple.xml" IN_FILE_1
SQL> CREATE TABLE TH_XML 2 ( 3 COL_ID_1 VARCHAR2(100 BYTE), 4 IN_FILE_1 XMLTYPE 5 ); Table created. SQL> host sqlldr control=test.ctl Username:dev Password: SQL*Loader: Release 11.2.0.2.0 - Production on Mer. Juil. 25 01:30:46 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Commit point reached - logical record count 1 SQL> set long 5000 SQL> column col_id_1 format a15 SQL> select * from th_xml; COL_ID_1 IN_FILE_1 --------------- -------------------------------------------------------------------------------- MYID1
Some Author1 Some Title1 Computer 44.95 2000-10-01 creating applications Some Author2 Some Title2 Computer 49.95 2001-04-16 Microsoft Visual Studio 7 is explored in depth -
Hi all
Orientation help need to load the XML file into Oralce 11 g R2 db (NOT XMLDB).
I went through some threads in the forums itself, but nothing is close to my requirement.
MY requirement is
I have a shared folder where to get several xml files (based on the volume of data, the number of the file will be very, mean the file number is not static)
all of this data file must be loaded into an oracle table.
It looks like something as below should be done (but don't know how to implement this)
identify each file in the folder (the unix loop),
using oracle, load data from this xml file into the oracle table
Continue the process until we reach the last file in the folder.
could you please shed some light on this...
Thanks in advance.
Here is an example of the incision I think you are trying to do... Notice that the upper level is driving the other levels (rankings, media).
Select hereby, wagneur, s.*
of temp_xml t
, XMLTable (XMLNamespaces (default 'http://www.abcs.com/fdp'), ' / Instrument_Roots/Instrument_Root ")
in passing t.object_value
columns
Path of varchar2 (100) Instrument_ID 'Instrument_ID '.
, Path of varchar2 (100) Deal_number 'Deal_number '.
, Path of varchar2 (100) Class_Code "Class_Code.
, Path of varchar2 (100) Class_Text "Class_Text.
, Path of xmltype rankings 'Instrument_Rankings '.
, Path of xmltype supports 'Instrument_Supports '.
) l
, XMLTable (XMLNamespaces (default 'http://www.abcs.com/fdp'),
' / Instrument_Rankings/Instrument_Ranking.
in passing l.Rankings
columns
Path of varchar2 (100) Ranking_Class_Number 'Ranking_Class_Number '.
, Path of varchar2 (100) Instrument_ID 'Instrument_ID '.
, Path of xmltype attributes 'Instrument_Ranking_Attributes '.
) d
, XMLTable (XMLNamespaces (default 'http://www.abcs.com/fdp'),
' / Instrument_Supports/Instrument_Support.
in passing l.Supports
columns
Path of varchar2 (100) Instrument_ID 'Instrument_ID '.
, Path of varchar2 (100) Support_ID 'Support_ID '.
, Path of varchar2 (100) Organization_ID 'Organization_ID '.
, Path of varchar2 (100) Organization_Role_Code 'Organization_Role_Code '.
, Path of varchar2 (100) Ranking_Class_Number 'Ranking_Class_Number '.
) s
-
What is recommended to load existing files CLOB data?
In another post ( Billy gave a great example of why you don't want to build on-the-fly SQL and what is the significance of the performance improvements are using shareable cursors.)
Part of the question that the OP was trying to solve, however, seems to come back several times and I saw a good response in any one place.
So for Billy or other, which is the recommended method for loading CLOB data (and only the existing files CLOB data.
1. the user and non-clob CLOB data.
2. the non-clob data are loaded (or can easily be loaded) in several ways using treatment in bulk.
3. the CLOB data exist in a file on a file system; each file must be associated with a unique ID value.
4 assume that all the files are in a physical location, but not on the database server.
5. Suppose you use 11 GR 2 (you can use an earlier version if you just want to mention what it is and why you chose it.
What options are available for loading CLOB data in Oracle and what is the recommended option?Whether to actually load the data into a CLOB or leave it on the file system with just a pointer from the database using a BFILE type is more a matter of architecture. Personally, I'd rather have LOB data in the database where you have the options of much more robust security, where it will include database backups, and where I don't have to worry that someone will inadvertently move files on the disk and break links to them. On the other hand, have the files on the file system allows you to use all the operating system utilities you have to manage or manipulate them without having to unload and reload (but you can use XML DB to expose LOB data in the database as if they were on a file server (if you want to go on the configuration path that). It reduces the size of the backup of the database (even if it increases the size of the file system backup). And it can allow you to use the less expensive disk to store large amounts of LOB data (although you might do the same in Oracle with the LOB data in a separate tablespace).
If you want to load LOB data, my preference would certainly be to have files on the database server (or a drive mounted on the database server) so that I could use external tables rather than SQL * Loader that makes it much easier to make loads in parallel and to trigger charges of the ETL process which is , presumably, running in the database.
Justin
-
Creating XML file using data from database table
I have to create an xml file by using the data in the table of multiples. The problem that I face is data are huge it's millions, so I was wondering is it possible efective for the creation of an XML of this type.
It would be great if you can suggest an approach to achieve my requirement.
Thank you
-VinodAn example of the forum: Re: how to generate the XML from the database table
Published by: Marco Gralike on 18 October 2012 21:41
-
custom preloader (loading xml files)
Hello :)
I want to create the preloader to load xml before application initialization files, I havn't could find no solution on any internet site :(?
I tried to extend the DownloadProgressBar and then load the xml in the constructor, but systemManager starts initialization of my Application right after that, and before that the preloader is finished, how can I force him to wait until I'm done with loading XML?
Thanks for any help :) I hope someone can help me :)
My request and the rest of my containers needs these xml files to initialize.
Thank you once again :)
Kind regards
HW2002For other issues with the same problem, which is a lot :)
You can load your XML files inside createChildren() (), you must override it in your application class and once that the XML file is loaded, call you super.createChildren ();
and it's all :)
-
Problem loading XML file on the server hosting
I have a question wher the lods of XML data very well file and displays on my server testingg but returns "undefined" when uploaded to the server hosting.
The page can be found at http://www.merryheartpuppets.com/index3.html
The ActionScript for the clip is included below:
The SWF works! and the xml data are read and displayed correctly. I always get an error when you try to view the slideshow.xml in the browser even with the changes.
I think that the happy ending is the result of several things:
1 make the changes suggested by GWD and
2 pointing the domain to the appropriate folder. For some reason, the hosting server was not pointing to the folder to which I had originally put in it. Then, I changed it. But the change doesn't take effect for some reason any. In any case, after further investigation, I got the domain pointing to the appropriate subfolder and the swf file is working now.Thank you all for your patience to input and advice. I could not successfully achieved this without your intervention. TX!
-
The ERPi load mapping file for data import error
Hello
I am creating the ERPi mapping and download of mapping for a dimension via a file. It gives an error. I use the explicit mapping. Please help me with this. Error screenshot is attached.
Hello Asad,
Create a unique mapping using the FDM web application and then export the map that you just created and it will show the required format
Rgds,
SH
-
Hello
The attached xml file contains data that I would like to extract. The value of the data has the label (ubchild? name /) of ' means ".". " This can happen a number of times in the file for the names of different children. for example
SENS0710:10951:IntSolIrr has the value that742.320755 and
SMBAU008:154000347:m_S0 kWh has the value that227.458679 and so on...
The attached vi is very very simple and uses the vi JKI EasyXML to parse the file to a data type of labview.
This is the point at which I need advice as to the way forward. I have reflected on the variant data, clusters, etc., but can't seem to get anything close to work.
Someone would be kind enough to give me some tips or tricks to extract these values in a table.
Thankl you
Concerning
Ray
Hi rayclout,
I don't have parser Xml JKI vi... But I used the default XML functions and can read the average tag. Please find the screenshot of it.
Thank you and best regards,
srikrishnaNF
-
export data from the table in xml files
Hello
This thread to get your opinion on how export data tables in a file xml containing the data and another (xsd) that contains a structure of the table.
For example, I have a datamart with 3 dimensions and a fact table. The idea is to have an xml file with data from the fact table, a file xsd with the structure of the fact table, an xml file that contains the data of the 3 dimensions and an xsd file that contains the definition of all the 3 dimensions. So a xml file fact table, a single file xml combining all of the dimension, the fact table in the file a xsd and an xsd file combining all of the dimension.
I never have an idea on how to do it, but I would like to have for your advise on how you would.
Thank you in advance.You are more or less in the same situation as me, I guess, about the "ORA-01426 digital infinity. I tried to export through UTL_FILE, content of the relational table with 998 columns. You get very quickly in this case in these ORA-errors, even if you work with solutions CLOB, while trying to concatinate the column into a CSV string data. Oracle has the nasty habbit in some of its packages / code to "assume" intelligent solutions and converts data types implicitly temporarily while trying to concatinate these data in the column to 1 string.
The second part in the Kingdom of PL/SQL, it is he's trying to put everything in a buffer, which has a maximum of 65 k or 32 k, so break things up. In the end I just solved it via see all as a BLOB and writing to file as such. I'm guessing that the ORA-error is related to these problems of conversion/datatype buffer / implicit in the official packages of Oracle DBMS.
Fun here is that this table 998 column came from XML source (aka "how SOA can make things very complicated and non-performing"). I have now 2 different solutions 'write data to CSV' in my packages, I use this situation to 998 column (but no idea if ever I get this performance, for example, using table collections in this scenario will explode the PGA in this case). The only solution that would work in my case is a better physical design of the environment, but currently I wonder not, engaged, as an architect so do not have a position to impose it.
-- --------------------------------------------------------------------------- -- PROCEDURE CREATE_LARGE_CSV -- --------------------------------------------------------------------------- PROCEDURE create_large_csv( p_sql IN VARCHAR2 , p_dir IN VARCHAR2 , p_header_file IN VARCHAR2 , p_gen_header IN BOOLEAN := FALSE, p_prefix IN VARCHAR2 := NULL, p_delimiter IN VARCHAR2 DEFAULT '|', p_dateformat IN VARCHAR2 DEFAULT 'YYYYMMDD', p_data_file IN VARCHAR2 := NULL, p_utl_wra IN VARCHAR2 := 'wb') IS v_finaltxt CLOB; v_v_val VARCHAR2(4000); v_n_val NUMBER; v_d_val DATE; v_ret NUMBER; c NUMBER; d NUMBER; col_cnt INTEGER; f BOOLEAN; rec_tab DBMS_SQL.DESC_TAB; col_num NUMBER; v_filehandle UTL_FILE.FILE_TYPE; v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file); v_CRLF raw(2) := HEXTORAW('0D0A'); v_chunksize pls_integer := 8191 - UTL_RAW.LENGTH( v_CRLF ); BEGIN c := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE); DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab); -- FOR j IN 1..col_cnt LOOP CASE rec_tab(j).col_type WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,4000); WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val); WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val); ELSE DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,4000); END CASE; END LOOP; -- -------------------------------------- -- This part outputs the HEADER if needed -- -------------------------------------- v_filehandle := UTL_FILE.FOPEN(upper(p_dir),p_header_file,p_utl_wra,32767); -- IF p_gen_header = TRUE THEN FOR j IN 1..col_cnt LOOP v_finaltxt := ltrim(v_finaltxt||p_delimiter||lower(rec_tab(j).col_name),p_delimiter); END LOOP; -- -- Adding prefix if needed IF p_prefix IS NULL THEN UTL_FILE.PUT_LINE(v_filehandle, v_finaltxt); ELSE v_finaltxt := 'p_prefix'||p_delimiter||v_finaltxt; UTL_FILE.PUT_LINE(v_filehandle, v_finaltxt); END IF; -- -- Creating creating seperate header file if requested IF NOT v_samefile THEN UTL_FILE.FCLOSE(v_filehandle); END IF; END IF; -- -------------------------------------- -- This part outputs the DATA to file -- -------------------------------------- IF NOT v_samefile THEN v_filehandle := UTL_FILE.FOPEN(upper(p_dir),p_data_file,p_utl_wra,32767); END IF; -- d := DBMS_SQL.EXECUTE(c); LOOP v_ret := DBMS_SQL.FETCH_ROWS(c); EXIT WHEN v_ret = 0; v_finaltxt := NULL; FOR j IN 1..col_cnt LOOP CASE rec_tab(j).col_type WHEN 1 THEN -- VARCHAR2 DBMS_SQL.COLUMN_VALUE(c,j,v_v_val); v_finaltxt := v_finaltxt || p_delimiter || v_v_val; WHEN 2 THEN -- NUMBER DBMS_SQL.COLUMN_VALUE(c,j,v_n_val); v_finaltxt := v_finaltxt || p_delimiter || TO_CHAR(v_n_val); WHEN 12 THEN -- DATE DBMS_SQL.COLUMN_VALUE(c,j,v_d_val); v_finaltxt := v_finaltxt || p_delimiter || TO_CHAR(v_d_val,p_dateformat); ELSE v_finaltxt := v_finaltxt || p_delimiter || v_v_val; END CASE; END LOOP; -- v_finaltxt := p_prefix || v_finaltxt; IF SUBSTR(v_finaltxt,1,1) = p_delimiter THEN v_finaltxt := SUBSTR(v_finaltxt,2); END IF; -- FOR i IN 1 .. ceil( LENGTH( v_finaltxt ) / v_chunksize ) LOOP UTL_FILE.PUT_RAW( v_filehandle, utl_raw.cast_to_raw( SUBSTR( v_finaltxt, ( i - 1 ) * v_chunksize + 1, v_chunksize ) ), TRUE ); END LOOP; UTL_FILE.PUT_RAW( v_filehandle, v_CRLF ); -- END LOOP; UTL_FILE.FCLOSE(v_filehandle); DBMS_SQL.CLOSE_CURSOR(c); END create_large_csv;
-
Cannot load the local xml file from swf
Hello!
I have next construction
(1) in ai3r app to load the SWF by HTMLLoader
(2) I'm trying to load local xml file in swf. No error and no results.
Application of AIR-> SWF-> load xml
When I load xml file site, everything is ok, but when I load just from local file , nothing happens
and when I load the local file with swf but everything is ok in the browser (firefox)
for loading xml in a I use the following path: file:///folder_name/xml_file_name.xml
Help me please!
Did you write the SWF? Some sovereign wealth funds will remove errors.
Why use HTMLLoader? Who can load it with different security rules. Content browser often cannot access local content.
-
Loading multiple Xml files.
Ive got a menu based on xml and xml Photo Gallery based on the same chassis on my calendar.
When I try to preview the film only the photogallery load xml file.
I was wondering if anyone knows a method to load two xml files at a time or one after the other...
Ive been after Jacques tutorials for menu xml and xml photo gallery... my code is very similar to them.
Thanks in advance.
Chris.Simply create separate XML objects.
myXmlMenu = new XML();
myXmlGallery = new XML();
myXmlMenu.load (...)
myXmlGallery.load (...)
etc. -
Getting data from several XML files
Could someone please shed some light on the best way to read several external xml files through Flex? We haveabout 100 xml files (of which few are accessible by users).
I tried to implement the following generic function which takes a file name, but when debugging it, it seems that the Manager never gets call after executing the line of service.send ()! I would much appreciate your help!
public void fetchFileContent(fileName:String):void {//this method is called when you click on a button
var service: HTTPService = new HTTPService();
service. URL = "filePath /" + file name;
service.useProxy = false;
service.resultFormat = 'e4x ';
service.addEventListener ("result", fileRetrievalHandler)
service. Send();
}
public void fileRetrievalHandler(evnt:ResultEvent):void {}
fileContent = evnt.result.feed; This line is never executed
}
"miglara" wrote in message
News:glhase$5sr$1@forums. Macromedia.com...
> Could someone please shed some light on the best way to read more
> external xml files through Flex? We haveabout 100 xml files (of
> who
(> only little is accessed randomly by users).
> I tried to implement the following generic function which takes a
> filename
> but when debugging it, it seems that the Manager never gets call after
> executing the line of service.send ()! I would much appreciate your help!
>
> public void fetchFileContent(fileName:String):void {//this method is
> called by clicking on a button
> var service: HTTPService = new HTTPService();
> service.url = ' filePath / "+ file name;
> service.useProxy = false;
> service.resultFormat = 'e4x ';
> service.addEventListener ("result", fileRetrievalHandler)
> service.send ();
> }
>
> public void fileRetrievalHandler(evnt:ResultEvent):void {}
> fileContent = evnt.result.feed; This line is never executed
> }Try to add a fault handler and see if that goes off. Also, since you are
use HTTPService rather than URLLoader, you should know that this will probably not
already worked for your development environment, unless you have either changed the
Directory of output to go on the server or you have changed some compiler flags
to allow you to get local and access to the network at the same time. That's why
I always use URLLoader to load XML files to relative path... it just
works without my need to change anything.
Maybe you are looking for
-
Where is the return on magical keyboard key without sending?
I recently bought a new iMac. When you type a message, I want to start a new paragraph, but when I hit the Enter key, the message is sent instead of going to a new line. What is the combination of keys to start a new paragraph. No instructions are pr
-
reset only your ID for me apple is hidden? !!!
Hello I forgot the security question apple id? Why the Option reset your ID question apple is hidden for me? Please, help me
-
Toshiba 19DV615Y: 12V battery - how many amperes / hour would be used?
REF TV / DVD 19DV615Y - when on the campsite using a 12 volt battery, how many amperes / hour would be used.Info sought to assess the size of the required inverter.
-
Re: Problem with Wifi on satellite series
Hi, no idea why it stopped?I logged in using a dongle, but why it stops, I tried a new router, but that didn't work either.Thank you
-
Missing wireless network adapter
HI -. I've seen a number of similar questions but no solution to my problem. My system:Toshiba A505-S6980Windows 7 Home Premium - 64-bitRealtek WLAN driver Problem:After the resumption of a sleep, the network adapter dissappeared. This has happened