How to load jpeg-xr file in as3?
I tried loader class but it report
Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.
here is my code:
package sandbox
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.net.URLStream;
import flash.utils.ByteArray;
public class TestJxr extends Sprite
private var loader:URLStream;
public function TestJxr()
// loader = new URLStream();
// loader.addEventListener(Event.COMPLETE, onBytesLoaded);
// // loader.addEventListener(ProgressEvent.PROGRESS, progress);
// loader.load(new URLRequest("test.jxr"));
var l:URLLoader = new URLLoader();
l.dataFormat = URLLoaderDataFormat.BINARY;
l.addEventListener(Event.COMPLETE,onBytesLoaded);
l.load(new URLRequest("test.jxr"));
private function onBytesLoaded(e:Event): void
var bmdBytes:ByteArray = (e.target as URLLoader).data;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
loader.loadBytes(bmdBytes);
// loader.removeEventListener(Event.COMPLETE, onBytesLoaded);
// var stream:URLStream = e.target as URLStream;
// var bytes:ByteArray = new ByteArray()
// stream.readBytes(bytes);
// var l:Loader = new Loader();
// l.loadBytes(bytes);
// l.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
private function onLoaded(e:Event): void
var bmd:BitmapData = ((e.target as LoaderInfo).content as Bitmap).bitmapData;
// e.target.removeEventListener(Event.COMPLETE, onLoaded);
// addChild(e.currentTarget as DisplayObject);
I gonna answer this question my own, the jpeg-xr format saved by photoshop with plug-in is not gonna work with flash
but the flash and xnviewer converted one worked.
Similar Messages
-
How to load a Jar file in the class path?
How to load a Jar file which contains class files, images, etc.. in the classpath without using URLClassLoader.
You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.
-
How to load a client file in a clob using sqlcl
How to load a client file in a clob using sqlcl
You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.
-
How to load an XML file to oracle9i server?
I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
Somebody help me?I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
Somebody help me? -
"how to load a text file to oracle table"
hi to all
can anybody help me "how to load a text file to oracle table", this is first time i am doing, plz give me steps.
Regards
MKhaleelUsage: SQLLOAD keyword=value [,keyword=value,...]
Valid Keywords:
userid -- ORACLE username/password
control -- Control file name
log -- Log file name
bad -- Bad file name
data -- Data file name
discard -- Discard file name
discardmax -- Number of discards to allow (Default all)
skip -- Number of logical records to skip (Default 0)
load -- Number of logical records to load (Default all)
errors -- Number of errors to allow (Default 50)
rows -- Number of rows in conventional path bind array or between direct path data saves (Default: Conventional path 64, Direct path all)
bindsize -- Size of conventional path bind array in bytes (Default 256000)
silent -- Suppress messages during run (header, feedback, errors, discards, partitions)
direct -- use direct path (Default FALSE)
parfile -- parameter file: name of file that contains parameter specifications
parallel -- do parallel load (Default FALSE)
file -- File to allocate extents from
skip_unusable_indexes -- disallow/allow unusable indexes or index partitions (Default FALSE)
skip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable (Default FALSE)
commit_discontinued -- commit loaded rows when load is discontinued (Default FALSE)
readsize -- Size of Read buffer (Default 1048576)
external_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE
(Default NOT_USED)
columnarrayrows -- Number of rows for direct path column array (Default 5000)
streamsize -- Size of direct path stream buffer in bytes (Default 256000)
multithreading -- use multithreading in direct path
resumable -- enable or disable resumable for current session (Default FALSE)
resumable_name -- text string to help identify resumable statement
resumable_timeout -- wait time (in seconds) for RESUMABLE (Default 7200)
PLEASE NOTE: Command-line parameters may be specified either by position or by keywords. An example of the former case is 'sqlldr scott/tiger foo'; an example of the latter is 'sqlldr control=foo userid=scott/tiger'. One may specify parameters by position before but not after parameters specified by keywords. For example, 'sqlldr scott/tiger control=foo logfile=log' is allowed, but 'sqlldr scott/tiger control=foo log' is not, even though the position of the parameter 'log' is correct.
SQLLDR USERID=GROWSTAR/[email protected] CONTROL=D:\PFS2004.CTL LOG=D:\PFS2004.LOG BAD=D:\PFS2004.BAD DATA=D:\PFS2004.CSV
SQLLDR USERID=GROWSTAR/[email protected] CONTROL=D:\CLAB2004.CTL LOG=D:\CLAB2004.LOG BAD=D:\CLAB2004.BAD DATA=D:\CLAB2004.CSV
SQLLDR USERID=GROWSTAR/[email protected] CONTROL=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.CTL LOG=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.LOG BAD=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.BAD DATA=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.CSV -
How to execute one .exe file with as3 in air ?
Hi
How to execute one .exe file with as3 in air?
I want do this work without fscommand .
plize help me .itsdhanasaraa wrote:
But as this a web application ... By using Runtime i'm getting some probs ..
Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
Ain't gonna happen.
its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
1) it's not "taking more time to execute", whatever that's supposed to mean.
2) there's no other way to execute something. Not that you should every use even that way anyway
3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place. -
How to load 100 CSV file to DSO / InfoCube
Hi
How to load 100 CSV files of transcational data to DSO / InfoCube?Hi,
you can achieve to write the .bat (batch file program in windows)
.bat program it will convert to xsl to .CSV format.
in process chain you can use the OS COMMAND option while creating process chain.
it will first trigger the bat file then it will trigger the excel files and info package.
now i am also working on same scenario now.
please find the below doc how to create the process chain using os command.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0c41c52-2638-2e10-0b89-ffa4e2f10ac0?QuickLink=index&…
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3034bf3d-9dc4-2d10-9e93-d4ba01505ed9?QuickLink=index&…
Thanks,
Phani. -
How to load a .cap file
i am new to smartcard programming...
now i am able to compile sample card program and and generated .cap file.
now my question is how to load that .cap file onto simulator and also smartcard.
my requirement is to store some value on smart card and retrive that value and update it. what is the process to achive this.plz mail me in detail to my id : [email protected] or [email protected]
advance thanks for mailing to me ....i am new to smartcard programming...
now i am able to compile sample card program and and generated .cap file.
now my question is how to load that .cap file onto simulator and also smartcard.
my requirement is to store some value on smart card and retrive that value and update it. what is the process to achive this.plz mail me in detail to my id : [email protected] or [email protected]
advance thanks for mailing to me .... -
How to load jpeg images in database?
I have an employees panel and it has a box to show employee's picture. Normally I double click on the box and it takes me to the folder where I have stored all employees jpeg file. I click on the one I need and then insert, it shows up on the panel and also saving the data in a table called PS_EMPLOYEE_IMAGE table.
If I want to insert number of images at one time thru the back end like sqlplus is there a way to do it? This saves me lot of time instead of entering thru the panel. Can it be done? For example fot employee1 insert jpeg1, employee2 jpeg2 etc. DO I have to use any tool to convert these jpeg files into some other data and then insert it? Is there any pl/sql package to do it?. If some one can explain me with simple explanation I really appreciate as I am not an real oracle person. Googling for this issue says it can be done but it is not very clear in steps of doing it.Thanks for your help. I did exactly like what you described (see below)
1) I created a image_file.txt file as shown below
EMPLID|EFFDT|EFF_STATUS|IMAGE_FILE
100000|08-FEB-2011|A|H:\SQL_Loader\George_Test.jpg
100001|08-FEB-2011|A|H:\SQL_Loader\Eftihia_Test.jpg
2) Then created EE_Image_Tbl.ctl file as shown below.
OPTIONS (DIRECT=TRUE, SKIP=1)
UNRECOVERABLE
LOAD DATA
APPEND
INTO TABLE PS_EMPLOYEE_IMAGE
FIELDS TERMINATED BY '|'
(EMPLID
,EFFDT
,EFF_STATUS
,IMAGE_FILE FILLER CHAR(80)
,EE_IMAGE LOBFILE(IMAGE_FILE) TERMINATED BY EOF)
3) then used the sql loader (load_ee_image.sql)
$ sqlldr DH5M/ep5evs1@KDH5MI01 control=h:\sql_loader\EE_Image_Tbl.ctl log=h:\sql_loader\load_ee_image.log data=h:\sql_loader\image_file.txt
SQL> --*
SQL> commit;
Commit complete.
SQL> --*
SQL> @h:\sql_loader\load_ee_image.sql;
SQL> $ sqlldr DH5M/ep5evs1@KDH5MI01 control=h:\sql_loader\EE_Image_Tbl.ctl log=h:\sql_loader\load_ee_image.log data=h:\sql_loader\image_file.txt
SQL> --*
SQL> --*
SQL> --*
SQL> commit;
Commit complete.
SQL> --rollback;
SQL> --*
SQL> spool off
L
Number to skip: 1
Errors allowed: 50
Continuation: none specified
Path used: Direct
Load is UNRECOVERABLE; invalidation redo is produced.
Table PS_EMPLOYEE_IMAGE, loaded from every logical record.
Insert option in effect for this table: APPEND
Column Name Position Len Term Encl Datatype
EMPLID FIRST * | CHARACTER
EFFDT NEXT * | CHARACTER
EFF_STATUS NEXT * | CHARACTER
IMAGE_FILE NEXT 80 | CHARACTER
(FILLER FIELD)
EE_IMAGE DERIVED * EOF CHARACTER
Dynamic LOBFILE. Filename in field IMAGE_FILE
SQL*Loader-418: Bad datafile datatype for column EE_IMAGE
This is becasue my image datatype can be declared as LONG RAW dara type thru my application.
When I created a table with image datatype as BLOB it worked.
But I want to insert into the existing table where image is declared as LONG RAW. How to insert jpeg into this field. Do I have to convert anything? Thx.
Edited by: user5846372 on Feb 8, 2011 1:18 PM
Edited by: user5846372 on Feb 8, 2011 2:16 PM -
Hello,
I'm new with edge animate, but i fell in love with it.
I'd like to know, is it possible to load different html pages dynamically in the main stage in order to avoid the preloader to be load?
I can figure out how to save all the pages of the site, but i can't merge them in a continuous animated browsing experience.
As sample.
I've got a index.html and home.html, how to switch form index to home without having a clear division between the two pages?
I can place all the animations within a file and this will allow me to have a continuous surfing experience but it won't generate specific and google indexable pages within the site.
Example, index.html will generate www.mysite.com, home will generate www.mysite.com/home. How ho switch dinamically between them and integrate them in a unique fading experience?
Thanks in advance for any help. I'm a newby, but i would like to learn.
Fea.Look into using the Loader class to load the swf files. If you want to have it happen in different frames then you can put the code into the different frames.
-
How to load a CSF file in indesign cs3 via scripting?
Hi all
How can I load a csf file into indesign from a path?. Once loaded, it is not remaining in dropdown list. Could anyone suggest on this?
Thanks
ThamilOnce loaded, it is not remaining in dropdown list. Could anyone suggest on this?
Try to place the file to the following folder: YourUserFolder\Library\Application Support\Adobe\Color\Settings
(This is for Mac)
How can I load a csf file into indesign from a path?
By script you can do this like so:
var myPath = "~/Desktop/MySettings.csf";
var myFile = new File (myPath);
if (myFile.exists) {
app.colorSettings.cmsSettingsPath = myFile;
else {
alert("File \""+ myPath + "\" can't be found."); -
How to load unicode data files with fixed records lengths?
Hi!
To load unicode data files with fixed records lengths (in terms of charachters and not of bytes!) using SQL*Loader manually, I found two ways:
Alternative 1: one record per row
SQL*Loader control file example (without POSITION, since POSITION always refers to bytes!)<br>
LOAD DATA
CHARACTERSET UTF8
LENGTH SEMANTICS CHAR
INFILE unicode.dat
INTO TABLE STG_UNICODE
TRUNCATE
A CHAR(2) ,
B CHAR(6) ,
C CHAR(2) ,
D CHAR(1) ,
E CHAR(4)
) Datafile:
001111112234444
01NormalDExZWEI
02ÄÜÖßêÊûÛxöööö
03ÄÜÖßêÊûÛxöööö
04üüüüüüÖÄxµôÔµ Alternative2: variable length records
LOAD DATA
CHARACTERSET UTF8
LENGTH SEMANTICS CHAR
INFILE unicode_var.dat "VAR 4"
INTO TABLE STG_UNICODE
TRUNCATE
A CHAR(2) ,
B CHAR(6) ,
C CHAR(2) ,
D CHAR(1) ,
E CHAR(4)
) Datafile:
001501NormalDExZWEI002702ÄÜÖßêÊûÛxöööö002604üuüüüüÖÄxµôÔµ Problems
Implementing these two alternatives in OWB, I encounter the following problems:
* How to specify LENGTH SEMANTICS CHAR?
* How to suppress the POSITION definition?
* How to define a flat file with variable length and how to specify the number of bytes containing the length definition?
Or is there another way that can be implemented using OWB?
Any help is appreciated!
Thanks,
Carsten.Hi Carsten
If you need to support the LENGTH SEMANTICS CHAR clause in an external table then one option is to use the unbound external table and capture the access parameters manually. To create an unbound external table you can skip the selection of a base file in the external table wizard. Then when the external table is edited you will get an Access Parameters tab where you can define the parameters. In 11gR2 the File to Oracle external table can also add this clause via an option.
Cheers
David -
Hello,
Someone please help me. What I am trying to do is load two .DLL files in my program. Program works fine when I
do the following way i.e. I have two .java files and in each I am loading one .DLL file. But I don't want to have
two .java files I want to load both the .DLL files in one program.
**************** Example.java **********
import java.io.*;
import java.util.*;
public class Example
public native int A(String in);
static
System.loadLibrary( "API2" );
public static void main( String args[])
Ex ex = new Ex();
int r;
r = ex.A("TEST");
public Example()
*****************Ex.java*****************
public class exsysml
public native int A(String in);
public exsysml()
System.loadLibrary("API3");
The above way works. But I need only one .java file to load both the .DLL files. i.e.
import java.io.*;
import java.util.*;
public class Example
public native int A(String in);
static
System.loadLibrary( "API2" );
System.loadLibrary( "API3" );
public static void main( String args[])
Example ex = new Example();
int r;
r = ex.A("TEST");
public Example()
but when I do this way it doesn't work and I get a UnSatisfiedLinkage Error at ex.A("TEST"). While doing the top way it works.
How can I fix this to just have one .java file and load both the library files as done in the bottom program but doing this program doesn't work. Any help is appreciated.
Thanks!what I figured out so far is that we can only load one library file in a single class and define all the native methods present in that library in the class where we are loading it. Means we can't load multiple library files in a single class. It's just my thought else if someone provides a better solution. I may be wrong so that's why I need your help.
Thanks -
How to load a XML file into a table using PL/SQL
Hi Guru,
I have a requirement, that i have to create a procedure or a package in PL/SQL to load XML file into a table.
How we can achive this.ODI_NewUser wrote:
Hi Guru,
I have a requirement, that i have to create a procedure or a package in PL/SQL to load XML file into a table.
How we can achive this.
Not a perfectly framed question. How do you want to load the XML file? Hoping you want to parse the xml file and load it into a table you can do this.
This is the xml file
karthick% cat emp_details.xml
<?xml version="1.0"?>
<ROWSET>
<ROW>
<EMPNO>7782</EMPNO>
<ENAME>CLARK</ENAME>
<JOB>MANAGER</JOB>
<MGR>7839</MGR>
<HIREDATE>09-JUN-1981</HIREDATE>
<SAL>2450</SAL>
<COM>0</COM>
<DEPTNO>10</DEPTNO>
</ROW>
<ROW>
<EMPNO>7839</EMPNO>
<ENAME>KING</ENAME>
<JOB>PRESIDENT</JOB>
<HIREDATE>17-NOV-1981</HIREDATE>
<SAL>5000</SAL>
<COM>0</COM>
<DEPTNO>10</DEPTNO>
</ROW>
</ROWSET>
You can write a query like this.
SQL> select *
2 from xmltable
3 (
4 '/ROWSET/ROW' passing xmltype
5 (
6 bfilename('SDAARBORDIRLOG', 'emp_details.xml')
7 , nls_charset_id('AL32UTF8')
8 )
9 columns empno number path 'EMPNO'
10 , ename varchar2(6) path 'ENAME'
11 , job varchar2(9) path 'JOB'
12 , mgr number path 'MGR'
13 , hiredate varchar2(20)path 'HIREDATE'
14 , sal number path 'SAL'
15 , com number path 'COM'
16 , deptno number path 'DEPTNO'
17 );
EMPNO ENAME JOB MGR HIREDATE SAL COM DEPTNO
7782 CLARK MANAGER 7839 09-JUN-1981 2450 0 10
7839 KING PRESIDENT 17-NOV-1981 5000 0 10
SQL> -
How to load a XML file into a table
Hi,
I've been working on Oracle for many years but for the first time I was asked to load a XML file into a table.
As an example, I've found this on the web, but it doesn't work
Can someone tell me why? I hoped this example could help me.
the file acct.xml is this:
<?xml version="1.0"?>
<ACCOUNT_HEADER_ACK>
<HEADER>
<STATUS_CODE>100</STATUS_CODE>
<STATUS_REMARKS>check</STATUS_REMARKS>
</HEADER>
<DETAILS>
<DETAIL>
<SEGMENT_NUMBER>2</SEGMENT_NUMBER>
<REMARKS>rp polytechnic</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>3</SEGMENT_NUMBER>
<REMARKS>rp polytechnic administration</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>4</SEGMENT_NUMBER>
<REMARKS>rp polytechnic finance</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>5</SEGMENT_NUMBER>
<REMARKS>rp polytechnic logistics</REMARKS>
</DETAIL>
</DETAILS>
<HEADER>
<STATUS_CODE>500</STATUS_CODE>
<STATUS_REMARKS>process exception</STATUS_REMARKS>
</HEADER>
<DETAILS>
<DETAIL>
<SEGMENT_NUMBER>20</SEGMENT_NUMBER>
<REMARKS> base polytechnic</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>30</SEGMENT_NUMBER>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>40</SEGMENT_NUMBER>
<REMARKS> base polytechnic finance</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>50</SEGMENT_NUMBER>
<REMARKS> base polytechnic logistics</REMARKS>
</DETAIL>
</DETAILS>
</ACCOUNT_HEADER_ACK>
For the two tags HEADER and DETAILS I have the table:
create table xxrp_acct_details(
status_code number,
status_remarks varchar2(100),
segment_number number,
remarks varchar2(100)
before I've created a
create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
and after, can you give me a script for loading data by using XMLTABLE?
I've tried this but it doesn't work:
DECLARE
acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
BEGIN
insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
select x1.status_code,
x1.status_remarks,
x2.segment_number,
x2.remarks
from xmltable(
'/ACCOUNT_HEADER_ACK/HEADER'
passing acct_doc
columns header_no for ordinality,
status_code number path 'STATUS_CODE',
status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
'$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
passing acct_doc as "d",
x1.header_no as "hn"
columns segment_number number path 'SEGMENT_NUMBER',
remarks varchar2(100) path 'REMARKS'
) x2
END;
This should allow me to get something like this:
select * from xxrp_acct_details;
Statuscode status remarks segement remarks
100 check 2 rp polytechnic
100 check 3 rp polytechnic administration
100 check 4 rp polytechnic finance
100 check 5 rp polytechnic logistics
500 process exception 20 base polytechnic
500 process exception 30
500 process exception 40 base polytechnic finance
500 process exception 50 base polytechnic logistics
but I get:
Error report:
ORA-06550: line 19, column 11:
PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
ORA-06550: line 4, column 2:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
and if I try to change the script without using the column HEADER_NO to keep track of the header rank inside the document:
DECLARE
acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
BEGIN
insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
select x1.status_code,
x1.status_remarks,
x2.segment_number,
x2.remarks
from xmltable(
'/ACCOUNT_HEADER_ACK/HEADER'
passing acct_doc
columns status_code number path 'STATUS_CODE',
status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
'/ACCOUNT_HEADER_ACK/DETAILS'
passing acct_doc
columns segment_number number path 'SEGMENT_NUMBER',
remarks varchar2(100) path 'REMARKS'
) x2
END;
I get this message:
Error report:
ORA-19114: error during parsing the XQuery expression:
ORA-06550: line 1, column 13:
PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
ORA-06512: at line 4
19114. 00000 - "error during parsing the XQuery expression: %s"
*Cause: An error occurred during the parsing of the XQuery expression.
*Action: Check the detailed error message for the possible causes.
My oracle version is 10gR2 Express Edition
I do need a script for loading xml files into a table as soon as possible, Give me please a simple example for understanding and that works on 10gR2 Express Edition
Thanks in advance!The reason your first SQL statement
select x1.status_code,
x1.status_remarks,
x2.segment_number,
x2.remarks
from xmltable(
'/ACCOUNT_HEADER_ACK/HEADER'
passing acct_doc
columns header_no for ordinality,
status_code number path 'STATUS_CODE',
status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
'$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
passing acct_doc as "d",
x1.header_no as "hn"
columns segment_number number path 'SEGMENT_NUMBER',
remarks varchar2(100) path 'REMARKS'
) x2
returns the error you noticed
PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
is because Oracle is expecting XML to be passed in. At the moment I forget if it requires a certain format or not, but it is simply expecting the value to be wrapped in simple XML.
Your query actually runs as is on 11.1 as Oracle changed how that functionality worked when 11.1 was released. Your query runs slowly, but it does run.
As you are dealing with groups, is there any way the input XML can be modified to be like
<ACCOUNT_HEADER_ACK>
<ACCOUNT_GROUP>
<HEADER>....</HEADER>
<DETAILS>....</DETAILS>
</ACCOUNT_GROUP>
<ACCOUNT_GROUP>
<HEADER>....</HEADER>
<DETAILS>....</DETAILS>
</ACCOUNT_GROUP>
</ACCOUNT_HEADER_ACK>
so that it is easier to associate a HEADER/DETAILS combination? If so, it would make parsing the XML much easier.
Assuming the answer is no, here is one hack to accomplish your goal
select x1.status_code,
x1.status_remarks,
x3.segment_number,
x3.remarks
from xmltable(
'/ACCOUNT_HEADER_ACK/HEADER'
passing acct_doc
columns header_no for ordinality,
status_code number path 'STATUS_CODE',
status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
'$d/ACCOUNT_HEADER_ACK/DETAILS'
passing acct_doc as "d",
columns detail_no for ordinality,
detail_xml xmltype path 'DETAIL'
) x2,
xmltable(
'DETAIL'
passing x2.detail_xml
columns segment_number number path 'SEGMENT_NUMBER',
remarks varchar2(100) path 'REMARKS') x3
WHERE x1.header_no = x2.detail_no;
This follows the approach you started with. Table x1 creates a row for each HEADER node and table x2 creates a row for each DETAILS node. It assumes there is always a one and only one association between the two. I use table x3, which is joined to x2, to parse the many DETAIL nodes. The WHERE clause then joins each header row to the corresponding details row and produces the eight rows you are seeking.
There is another approach that I know of, and that would be using XQuery within the XMLTable. It should require using only one XMLTable but I would have to spend some time coming up with that solution and I can't recall whether restrictions exist in 10gR2 Express Edition compared to what can run in 10.2 Enterprise Edition for XQuery.
Maybe you are looking for
-
Why do text messages from my iPad appear to some people as if they came from my email address instead of my phone number? This does not happen when I send text messages from my iPhone.
-
Hard Drive Recovery Not Working
Hi, I just got a new hard drive for my HP Pavilion DV6 with Windows 7 after the original one crashed. I am using recovery discs I made when I first got the computer to reformat it. The beginning of the installation process goes great. It prompts m
-
Frame artifacts appearing in PDF output
I have a problem with faint artifacts of object frames, rectangle frames and diagonals, etc. appearing in a PDF output when viewed in Acrobat Reader.They are hairline thin and are not visible in the InDesign document on screen. Here are the circumsta
-
Itunes 10.2 wont open in my windows 64-bit
hi guys, i've been trying to open my itunes 10.2 on my toshiba a665-s6089 windows 7 64-bit, but nothing works. from my past experience, i already used itunes 10.1 and it worked pretty well, but after i updated my itunes to 10.2, it won't work. Moreov
-
I am trying to update to iOS5 on my iPad 2, but after the download completes, and file processing starts, I get an error message "There was a problem downloading the software ... the network connection timed out." Diagnostic tests check out OK. Any