XML query over a socket
I can't seem to find any thing anywhere about doing this. I was want to be able to send a query:
<?xml version="1.0"?>
<query />
to a remote server (which will return a bunch of results). I've created an in/out socket... but that's about it.
Simple POST xml java client, takes URL and a number of terms as argument, constructs query document, sends it to server and echos response to standard output:import java.io.*;
import java.net.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
public class PostXml {
public static void main (String[] args) {
try {
final Document queryDocument = XmlUtils.createDocument("", "query");
final Element root = queryDocument.getDocumentElement();
for (int index = 1; index < args.length; index++) {
XmlUtils.addTextElement(root, "", "term", args[index]);
XmlUtils.echoXml(XmlUtils.parse(postXml(args[0], queryDocument)), System.out);
} catch (Exception ex) {
ex.printStackTrace(System.out);
public static InputStream postXml (String targetURL, Document document ) throws IOException {
final URLConnection connection = new URL(targetURL).openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestProperty("content-type", "application/xml");
XmlUtils.echoXml(document, connection.getOutputStream());
return connection.getInputStream();
}Servlet parses xml input and returns xml document based on the content:import java.io.IOException;
import java.io.Writer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
public class QueryServlet extends HttpServlet {
public void doPost (final HttpServletRequest request,
final HttpServletResponse response) throws IOException, ServletException {
response.setContentType("application/xml");
try {
final Document queryDocument = XmlUtils.parse(request.getInputStream());
final Element queryElement = queryDocument.getDocumentElement();
final NodeList terms = queryElement.getElementsByTagName("term");
final Document responseDocument = XmlUtils.createDocument("", "response");
final Element responseElement = responseDocument.getDocumentElement();
for (int index = 0; index < terms.getLength(); index++) {
XmlUtils.addTextElement(responseElement, "", "recieved", XmlUtils.textValue(terms.item(index)));
XmlUtils.echoXml(responseDocument, response.getOutputStream());
} catch (XmlException xe) {
XmlUtils.echoXml(XmlUtils.errorDocument(xe), response.getOutputStream());
public void doGet (final HttpServletRequest request,
final HttpServletResponse response) throws IOException {
response.setContentType("text/plain");
final Writer out = response.getWriter();
out.write("use POST");
}Utilities to hide much DOM cruft and checked exception proliferation:import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.xml.sax.SAXException;
import org.w3c.dom.Document;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
* Some of this removes oddities in DOM; most is wrapping exceptions so
* that the different toolkits throw the same exception for like operations.
public class XmlUtils {
static final DocumentBuilderFactory documentBuilderFactory;
static final DOMImplementation domImplementation;
static {
DocumentBuilderFactory factory = null;
DOMImplementation domI = null;
try {
factory = DocumentBuilderFactory.newInstance();
domI = factory.newDocumentBuilder().getDOMImplementation();
} catch (ParserConfigurationException pce) {
// log it
documentBuilderFactory = factory;
domImplementation = domI;
private static Transformer nullTransform;
public static void echoXml (final Document document, final OutputStream out) throws IOException {
try {
if (nullTransform == null) {
final TransformerFactory factory = TransformerFactory.newInstance();
nullTransform = factory.newTransformer();
nullTransform.transform(new DOMSource(document), new StreamResult(out));
} catch (TransformerException te) {
final IOException ioe = new IOException("failed to write document to stream");
ioe.initCause(te);
throw ioe;
public static Document errorDocument (final Throwable error) {
try {
final Document errorDocument = createDocument();
errorDocument.appendChild(errorElement(errorDocument, error));
return errorDocument;
} catch (XmlException xe) {
// as this is called to provide a document representing an error
// during error handling, throwing anything could cause a loop
return null;
static Element errorElement (final Document document, final Throwable error) {
final Element errorElement = document.createElementNS("", "error");
addTextElement(errorElement, "", "class", error.getClass().getName());
final StackTraceElement[] stack = error.getStackTrace();
for (int index = 0; index < stack.length; index++) {
addTextElement(errorElement, "", "stack", stack[index].toString());
if (error.getCause() != null) {
final Element causedBy = document.createElementNS("", "caused-by");
causedBy.appendChild(errorElement(document, error.getCause()));
errorElement.appendChild(causedBy);
return errorElement;
public static Element addTextElement (final Element parent, final String url, final String qname, final String content) {
final Document document = parent.getOwnerDocument();
final Element child = document.createElementNS(url, qname);
child.appendChild(document.createTextNode(content));
parent.appendChild(child);
return parent;
public static String textValue (final Node node) {
switch (node.getNodeType()) {
case Node.CDATA_SECTION_NODE:
case Node.TEXT_NODE : return node.getNodeValue();
default: return concat(node.getChildNodes(), new StringBuffer()).toString();
public static StringBuffer concat (final NodeList nodelist, final StringBuffer buffer) {
for (int index = 0, length = nodelist.getLength(); index < length; index++) {
final Node node = nodelist.item(index);
switch (node.getNodeType()) {
case Node.CDATA_SECTION_NODE:
case Node.TEXT_NODE : {
buffer.append(node.getNodeValue());
break;
case Node.ELEMENT_NODE: {
concat(node.getChildNodes(), buffer);
break;
return buffer;
public static Document parse (InputStream stream) throws XmlException, IOException {
try {
return documentBuilderFactory.newDocumentBuilder().parse(stream);
} catch (SAXException saxe) {
throw new XmlException(saxe);
} catch (ParserConfigurationException pce) {
throw new XmlException(pce);
public static Document createDocument (String url, String qname) {
return domImplementation.createDocument(url, qname, null);
public static Document createDocument () throws XmlException {
try {
return documentBuilderFactory.newDocumentBuilder().newDocument();
} catch (ParserConfigurationException pce) {
throw new XmlException(pce);
}
Similar Messages
-
Parse streaming XML over a socket
Is it possible to parse XML incrementally over a socket connection? I would like to parse and respond dyanamically to streaming XML and I am looking for some direction. Everything that I have read so far with respect to parsing XML from files. Thanks in advance
You will want to look into a SAX parser, they are specifically intended for parsing xml over an input stream. They call callbacks to handle each element that arrives from the socket.
However, there are a lot of posts about the sax parsers hanging, and I just posted last week trying to find the cause/solution. I've seen a number of solutions posted, but none have worked in my case. No replies to my post yet.
Steve -
Hi
I am working on BLS and having problem in xml query.I want to perform some calculation over xml columns.Than total of this as a new column.I can do this part in logic editor itself but can i do these both task by XSLT.
Can be made our own XSLT for this ?
I am feeling kind of fear to xslt. Can anybody help me in this.
Thanks a lot in advance
thomasRam,
In xMII there is a list of predefined xslt transforms that do something similar to what you are explaining. The 3 that I think may be what you are looking for are
they are under Calculation Transformations and Subtotal Transformation take a look at these and tell me if they are doing what you want to accomplish. In the xMII help file do a search on Inline Transforms or navigate to Advanced Topics -> Inline Transforms -> Predefined Inline Transforms. In this section there are examples of how to use these transforms and apply them in the query templates. If this is not what you are looking for can you explain in a little more detail along with a simple example of how you want this transform to work. Also why do you want to use xslt if you can already accomplish this in BLS?
Regards,
Erik -
Xcelsius with XMLA or XML Query Result Set
Hi Experts,
I want a direct connection from Xcelsius to my BW-Data. Because the new connection, coming with Fix Pack 2.1 is only avaiable for EHP 1 for NW 7.0 I tried to configure with XMLA and XML Query Result Set.
This Document tells the necessary steps: How to integrate Xcelsius 2008 with SAP NetWeaver BI without Integration Kit.pdf.
When I test my XML connection over http://<host>:<port>/TXmla/srvlet/TestXmla my Cubes will display.
So I do a Webservice-Connection with WSDL-URL. At Input-Values there are some entries like CUBE_NAME, CATALOG_NAME...
Output values arent avalible. How do I use these elements to show my Data in Xcelsius?
My Problem with the XML Query Result Set Connection is, that when I Log On to VC the following error appears:
You are not authorized to view the requested resource.
So I get the authorisationobjects: S_DEVELOP and S_RS_COMP as describe in 'How To... Resolve Visual Composer Issues'.
What values have I to enter by S_RS_COMP? And how can I enter my External Service in S_SERVICE. At the type WS the service isnt't avaiable.
Regards,
JanTo use XMLA web service you need a wrapper function build to convert the XMLA output to the Xcelsius format. There are some documents available in SDN on how to do this.
You can use Live Office or Query as a Web service option to connect from Xcelsius to BW.
S_RS_COMP is the query ID which you are trying to access, S_SERVICE you can either give * or try to set up authorization log and see the expected value. -
Cooresponding Lists Names/Values XML Query
Let's say there is an XML Schema that has
<element name="mt" minOccurs="0" maxOccurs="unbounded">
<element name="r" minOccurs="0" maxOccurs="unbounded">
And for each measurement type (mt), you have a cooresponding measurement value (r). There are additional elements between these two lists. The actual XML data would look similiar to
<mi>
<mts>20061117100000-0800</mts>
<gp>900</gp>
<mt>MeasurementType1</mt>
<mt>MeasurementType2</mt>
<mt>MeasurementType3</mt>
<mt>MeasurementType4</mt>
<mt>MeasurementType5</mt>
<mt>MeasurementType6</mt>
<mt>MeasurementType7</mt>
<mv>
<moid>Identifier</moid>
<r>58</r>
<r>62</r>
<r>43</r>
<r>45</r>
<r>43</r>
<r>14</r>
<r>29</r>
<sf>FALSE</sf>
</mv>
</mi>
The first occurance of mt corresponds to the first occurance of r, the second cooresponds to the second, et cetra.
The MI element can repeat hundreds of times and there can be many measurementTypes. Now, I'm trying to figure out how I can create an XML query to efficiently handle this. The problem is that the <r> value is within the complexType <mv> and that is on the same level as <mt>. The XML Query would cause a cartesian product if I were to use something like ...
select
extractValue(value(xmldata), '/mi/mts') measurement_time_stamp,
extractValue(value(xmldata), '/mi/gp') granularity_period,
extractValue(value(mt), '/mt') measurement_type,
extractValue(value(mv), '/mv/moid') measured_obj_id,
extractValue(value(r), '/r') measurement_value,
from xmltable
, TABLE(XMLSequence(Extract(value(xmltable), '/mi/mv'))) mv
, TABLE(XMLSequence(Extract(value(mi), '/mi/mt'))) mt
, TABLE(XMLSequence(Extract(value(mi), '/mv/r'))) r
This obviously wouldn't work. I could go and store all the types and values into a column using
select
replace(replace(replace(extract(value(mi), '/mi/mt').getStringVal(), '</mt><mt>', ';'), '<mt>'), '</mt>') measurement_type,
extractValue(value(mv), '/mv/moid') measured_obj_id,
replace(replace(replace(extract(value(mv), '/mv/r').getStringVal(), '</r><r>', ';'), '<r>'), '</r>') measurement_value
from xmltable
TABLE(XMLSequence(Extract(value(xmldata), '/md/mi'))) mi
, TABLE(XMLSequence(Extract(value(mi), '/mi/mv'))) mv
But this wouldn't work once the XML grew over 4000 bytes. So I need a way to extract this data maintaining the correct integrity (avoiding cartesians).
One idea is a pipelined table function but I have concerns about scalability with that method. Is there a way to accomplish this optimally? I have solutions for this but none of them is going to deliver the scalability I am seeking.
I expect the method chosen will probably need to handle a few hundred thousand files per day.
Thanks,VJ
I'd not seen your XML schema when I worked the original example, so I reverse engineered it from the instance. Unfortunately when I work with your schema, which contains more levels of nested I can't get it to optimize properly
Here's what should work in theory
SQL> set echo on
SQL> spool testcase.log
SQL> --
SQL> connect sys/ as sysdba
Enter password:
Connected.
SQL> set define on
SQL> --
SQL> define USERNAME = OTNTEST
SQL> --
SQL> def PASSWORD = OTNTEST
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> def LOCAL_FILESYSTEM = 'C:\xdb\otn\457595'
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user OTNTEST cascade
User dropped.
SQL> grant connect, resource to &USERNAME identified by &PASSWORD
2 /
old 1: grant connect, resource to &USERNAME identified by &PASSWORD
new 1: grant connect, resource to OTNTEST identified by OTNTEST
Grant succeeded.
SQL> grant create any directory, drop any directory to &USERNAME
2 /
old 1: grant create any directory, drop any directory to &USERNAME
new 1: grant create any directory, drop any directory to OTNTEST
Grant succeeded.
SQL> grant alter session, create view to &USERNAME
2 /
old 1: grant alter session, create view to &USERNAME
new 1: grant alter session, create view to OTNTEST
Grant succeeded.
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
new 1: alter user OTNTEST default tablespace USERS temporary tablespace TEMP
User altered.
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> alter session set events ='19027 trace name context forever, level 0x800'
2 /
Session altered.
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> create or replace directory XMLDIR as '&LOCAL_FILESYSTEM'
2 /
old 1: create or replace directory XMLDIR as '&LOCAL_FILESYSTEM'
new 1: create or replace directory XMLDIR as 'C:\xdb\otn\457595'
Directory created.
SQL> begin
2 :schemaURL := 'testcase.xsd';
3 :schemaPath := '/public/testcase.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL>
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5 <!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com)-->
6 <!--Please add namespace attributes, a targetNamespace attribute and import elements according to your requirements-->
7 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" attributeFormDefaul
t="unqualified" xdb:storeVarrayAsTable="true">
8 <xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
9 <xs:element name="mdc" xdb:defaultTable="MDC_TABLE">
10 <xs:complexType xdb:SQLType="MDC_TYPE" xdb:maintainDOM="false">
11 <xs:sequence>
12 <xs:element ref="mfh"/>
13 <xs:element ref="md" minOccurs="0" maxOccurs="unbounded"/>
14 <xs:element ref="mff"/>
15 </xs:sequence>
16 </xs:complexType>
17 </xs:element>
18 <xs:element name="mfh" xdb:defaultTable="">
19 <xs:complexType xdb:SQLType="MFH_TYPE" xdb:maintainDOM="false">
20 <xs:sequence>
21 <xs:element ref="ffv"/>
22 <xs:element ref="sn"/>
23 <xs:element ref="st"/>
24 <xs:element ref="vn"/>
25 <xs:element ref="cbt"/>
26 </xs:sequence>
27 </xs:complexType>
28 </xs:element>
29 <xs:element name="md" xdb:defaultTable="" >
30 <xs:complexType xdb:SQLType="MD_TYPE" xdb:maintainDOM="false">
31 <xs:sequence>
32 <xs:element ref="neid"/>
33 <xs:element ref="mi" minOccurs="0" maxOccurs="unbounded" />
34 </xs:sequence>
35 </xs:complexType>
36 </xs:element>
37 <xs:element name="neid" xdb:defaultTable="" >
38 <xs:complexType xdb:SQLType="NEID_TYPE" xdb:maintainDOM="false">
39 <xs:sequence>
40 <xs:element ref="neun"/>
41 <xs:element ref="nedn"/>
42 </xs:sequence>
43 </xs:complexType>
44 </xs:element>
45 <xs:element name="mi" xdb:defaultTable="" >
46 <xs:complexType xdb:SQLType="MI_TYPE" xdb:maintainDOM="false">
47 <xs:sequence>
48 <xs:element ref="mts"/>
49 <xs:element ref="gp"/>
50 <xs:element ref="mt" minOccurs="0" maxOccurs="unbounded"/>
51 <xs:element ref="mv" minOccurs="0" maxOccurs="unbounded" />
52 </xs:sequence>
53 </xs:complexType>
54 </xs:element>
55 <xs:element name="mv" xdb:defaultTable="" >
56 <xs:complexType xdb:SQLType="MV_TYPE" xdb:maintainDOM="false">
57 <xs:sequence>
58 <xs:element ref="moid"/>
59 <xs:element ref="r" minOccurs="0" maxOccurs="unbounded"/>
60 <xs:element ref="sf" minOccurs="0"/>
61 </xs:sequence>
62 </xs:complexType>
63 </xs:element>
64 <xs:element name="mff" xdb:defaultTable="" >
65 <xs:complexType xdb:maintainDOM="false">
66 <xs:sequence>
67 <xs:element ref="ts"/>
68 </xs:sequence>
69 </xs:complexType>
70 </xs:element>
71 <xs:element name="ts" type="xs:string"/>
72 <xs:element name="sf" type="xs:string"/>
73 <xs:element name="r">
74 <xs:complexType xdb:SQLType="R_TYTPE" xdb:maintainDOM="false">
75 <xs:simpleContent>
76 <xs:extension base="xs:string">
77 <xs:attribute ref="dummy" use="prohibited"/>
78 </xs:extension>
79 </xs:simpleContent>
80 </xs:complexType>
81 </xs:element>
82 <xs:attribute name="dummy" type="xs:boolean"/>
83 <xs:element name="mt">
84 <xs:complexType xdb:SQLType="MT_TYTPE" xdb:maintainDOM="false">
85 <xs:simpleContent>
86 <xs:extension base="xs:string">
87 <xs:attribute ref="dummy" use="prohibited"/>
88 </xs:extension>
89 </xs:simpleContent>
90 </xs:complexType>
91 </xs:element>
92 <xs:element name="moid" type="xs:string"/>
93 <xs:element name="gp" type="xs:string"/>
94 <xs:element name="mts" type="xs:string"/>
95 <xs:element name="nedn" type="xs:string"/>
96 <xs:element name="neun" type="xs:string"/>
97 <xs:element name="cbt" type="xs:string"/>
98 <xs:element name="vn" type="xs:string"/>
99 <xs:element name="st" type="xs:string"/>
100 <xs:element name="sn" type="xs:string"/>
101 <xs:element name="ffv" type="xs:string"/>
102 </xs:schema>');
103 begin
104 if (dbms_xdb.existsResource(:schemaPath)) then
105 dbms_xdb.deleteResource(:schemaPath);
106 end if;
107 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
108 end;
109 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> declare
2 nested_table_name varchar2(256);
3 iot_index_name varchar2(256);
4 begin
5 select table_name
6 into nested_table_name
7 from user_nested_tables
8 where parent_table_column = '"XMLDATA"."md"'
9 and parent_table_name = 'MDC_TABLE';
10
11 execute immediate 'rename "'|| nested_table_name ||'" to MD_TABLE';
12
13 select index_name
14 into iot_index_name
15 from user_indexes
16 where table_name = 'MD_TABLE' and index_type = 'IOT - TOP';
17
18 execute immediate 'alter index "'|| iot_index_name ||'" rename to MD_IOT';
19
20 select table_name
21 into nested_table_name
22 from user_nested_tables
23 where parent_table_column = 'mi'
24 and parent_table_name = 'MD_TABLE';
25
26 execute immediate 'rename "'|| nested_table_name ||'" to MI_TABLE';
27
28 select index_name
29 into iot_index_name
30 from user_indexes
31 where table_name = 'MI_TABLE' and index_type = 'IOT - TOP';
32
33 execute immediate 'alter index "'|| iot_index_name ||'" rename to MI_IOT';
34
35 select table_name
36 into nested_table_name
37 from user_nested_tables
38 where parent_table_column = 'mt'
39 and parent_table_name = 'MI_TABLE';
40
41 execute immediate 'rename "'|| nested_table_name ||'" to MT_TABLE';
42
43 select index_name
44 into iot_index_name
45 from user_indexes
46 where table_name = 'MT_TABLE' and index_type = 'IOT - TOP';
47
48 execute immediate 'alter index "'|| iot_index_name ||'" rename to MT_IOT';
49
50 select table_name
51 into nested_table_name
52 from user_nested_tables
53 where parent_table_column = 'mv'
54 and parent_table_name = 'MI_TABLE';
55
56 execute immediate 'rename "'|| nested_table_name ||'" to MV_TABLE';
57
58 select index_name
59 into iot_index_name
60 from user_indexes
61 where table_name = 'MV_TABLE' and index_type = 'IOT - TOP';
62
63 execute immediate 'alter index "'|| iot_index_name ||'" rename to MV_IOT';
64
65 select table_name
66 into nested_table_name
67 from user_nested_tables
68 where parent_table_column = 'r'
69 and parent_table_name = 'MV_TABLE';
70
71 execute immediate 'rename "'|| nested_table_name ||'" to R_TABLE';
72
73 select index_name
74 into iot_index_name
75 from user_indexes
76 where table_name = 'R_TABLE' and index_type = 'IOT - TOP';
77
78 execute immediate 'alter index "'|| iot_index_name ||'" rename to R_IOT';
79 end;
80 /
PL/SQL procedure successfully completed.
SQL> desc MDC_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "mdc") STORAGE Object-relational TYPE "MDC_TYPE"
SQL> --
SQL> desc MD_TABLE
Name Null? Type
neid NEID_TYPE
mi mi9495_COLL
SQL> --
SQL> desc MI_TABLE
Name Null? Type
mts VARCHAR2(4000 CHAR)
gp VARCHAR2(4000 CHAR)
mt mt9493_COLL
mv mv9494_COLL
SQL> --
SQL> desc MT_TABLE
Name Null? Type
SYS_XDBBODY$ VARCHAR2(4000 CHAR)
dummy RAW(1)
SQL> --
SQL> desc MV_TABLE
Name Null? Type
moid VARCHAR2(4000 CHAR)
r r9492_COLL
sf VARCHAR2(4000 CHAR)
SQL> --
SQL> desc R_TABLE
Name Null? Type
SYS_XDBBODY$ VARCHAR2(4000 CHAR)
dummy RAW(1)
SQL> --
SQL> set autotrace on explain
SQL> set lines 150 pages 100
SQL> --
SQL> var XMLTEXT varchar2(4000)
SQL> --
SQL> begin
2 :xmlText :=
3 '<mdc>
4 <mfh>
5 <ffv/>
6 <sn/>
7 <st/>
8 <vn/>
9 <cbt/>
10 </mfh>
11 <md>
12 <neid>
13 <neun/>
14 <nedn/>
15 </neid>
16 <mi>
17 <mts>20061117100000-0800</mts>
18 <gp>900</gp>
19 <mt>MeasurementType1</mt>
20 <mt>MeasurementType2</mt>
21 <mt>MeasurementType3</mt>
22 <mt>MeasurementType4</mt>
23 <mt>MeasurementType5</mt>
24 <mt>MeasurementType6</mt>
25 <mt>MeasurementType7</mt>
26 <mv>
27 <moid>Identifier</moid>
28 <r>58</r>
29 <r>62</r>
30 <r>43</r>
31 <r>45</r>
32 <r>43</r>
33 <r>14</r>
34 <r>29</r>
35 <sf>FALSE</sf>
36 </mv>
37 </mi>
38 </md>
39 <mff>
40 <ts/>
41 </mff>
42 </mdc>';
43 end;
44 /
PL/SQL procedure successfully completed.
SQL> insert into MDC_TABLE values ( xmltype ( :xmltext ))
2 /
1 row created.
Execution Plan
Plan hash value: 1621636734
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
| 1 | LOAD TABLE CONVENTIONAL | MDC_TABLE | | | | |
SQL> commit
2 /
Commit complete.
SQL> select MT_INDEX, MT_VALUE, R_VALUE
2 from MDC_TABLE,
3 xmlTable
4 (
5 '/mdc/md/mi'
6 passing object_value
7 columns
8 XML xmltype path '.'
9 ) MI,
10 xmlTable
11 (
12 '/mi/mt'
13 passing MI.XML
14 columns
15 MT_INDEX for ordinality,
16 MT_VALUE varchar2(32) path 'text()'
17 ) MT,
18 xmlTable
19 (
20 '/mi/mv/r'
21 passing MI.XML
22 columns
23 R_INDEX for ordinality,
24 R_VALUE varchar2(32) path 'text()'
25 ) R
26 where MT_INDEX = R_INDEX
27 /
MT_INDEX MT_VALUE R_VALUE
1 MeasurementType1 58
2 MeasurementType2 62
3 MeasurementType3 43
4 MeasurementType4 45
5 MeasurementType5 43
6 MeasurementType6 14
7 MeasurementType7 29
7 rows selected.
Execution Plan
Plan hash value: 2832518671
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 5449M| 19T| 1616M (1)|999:59:59 |
| 1 | NESTED LOOPS | | 5449M| 19T| 1616M (1)|999:59:59 |
| 2 | NESTED LOOPS | | 66M| 237G| 197K (1)| 00:39:36 |
| 3 | NESTED LOOPS | | 8168 | 29M| 27 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL | MDC_TABLE | 1 | 3788 | 3 (0)| 00:00:01 |
| 5 | COLLECTION ITERATOR PICKLER FETCH | XMLSEQUENCEFROMXMLTYPE | | | | |
| 6 | VIEW | | 8168 | 247K| 24 (0)| 00:00:01 |
| 7 | COUNT | | | | | |
| 8 | COLLECTION ITERATOR PICKLER FETCH| XMLSEQUENCEFROMXMLTYPE | | | | |
|* 9 | VIEW | | 82 | 2542 | 24 (0)| 00:00:01 |
| 10 | COUNT | | | | | |
| 11 | COLLECTION ITERATOR PICKLER FETCH | XMLSEQUENCEFROMXMLTYPE | | | | |
Predicate Information (identified by operation id):
4 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd http://xmlns.oracle.com/xdb/acl.xsd
DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-properties/><read-contents/></privilege>'))=1)
9 - filter("MT_INDEX"="R_INDEX")
Note
- dynamic sampling used for this statement
SQL>As you can see the re-write is not working out in this case. I'll ask development to take a look at it and see if they can solve it. I think it's similar to another bug I've filed...
WRT to your question about transforming. One easy transformation would be to number the nodes.. Eg use XSTL to add an index number to each MT node and each R node and then join on that value. -
Problem querying over two fact tables
The business requirement is that we want to be able to see sales for two different periods of times, over different brands, different Items' years and seasons per periods.
So for the different dimensions I created alias having two tables in the physical layer
for Brands, Shops and Items (tables) [These are the tables where I query for different brand, Item's year and different season]. The Business Model Schema looks like this:
Items-----> SALES <------Brands Items 2-----> SALES 2 <------------Brands 2
^ ^
TIMES TIMES 2 (TIMES JOINED WITH SALES AND TIMES 2 WITH SALES 2)
and VENDORS connected to both SALES & SALES 2 left outer joined
The need is that I need to query over two indepedent periods of time with independed dimensions but for a common dimension (Vendors).
The presentation data simplified looks like this:
Answers
Vendor Sales Qty Sales 2 Qty
1092 234 123
The problem is that when a vendor doesn't exist in one period it doesn't come and in the other although there are sales. So when I query with the same filters (same period of time, Brands, Items' years and seasons) over these two fact tables I get the same sales and correct data. When there are different criteria then I lose data.
The Query fired in the database is the following:
select distinct case when D2.c4 is not null then D2.c4 when D1.c4 is not null then D1.c4 end as c1,
D1.c3 as c4,
D1.c1 as c5,
D1.c2 as c6,
cast(D1.c2 / nullif( D1.c1, 0) * 100 as DOUBLE PRECISION ) as c7,
D2.c3 as c8,
D2.c1 as c9,
D2.c2 as c10,
cast(D2.c2 / nullif( D2.c1, 0) * 100 as DOUBLE PRECISION ) as c11
from
(select sum(T43161.amnt_1) as c1,
sum(T43161.mk_1) as c2,
sum(T43161.qty_1) as c3,
T7120.VE_NAME as c4
from
VE04_TBL T7120,
GE04_COMPANY_TBL T43802,
EI04_TBL T6931,
Salesmcost T43161
where ( T6931.EI_CODE = T43161.ei_code and T6931.VE_CODE = T7120.VE_CODE and T6931.GE_COMPANY_CODE = '1' and T6931.EI_SEASON_CODE = 'Χ' and T6931.EI_YEAR = '2009' and T7120.GE_COMPANY_CODE = '1' and T7120.VE_CODE = T43161.ve_code and T43161.ge_company_code = T43802.GE_COMPANY_CODE and T43802.GE_COMPANY_NAME = '*** Φ. & Κ. ΛΕΜΟΝΗΣ ΑΕΒΕ ****' and T43802.LIST_ITEM_IND = '1' and T43161.trans_date >= ADD_MONTHS(TO_DATE('2010-05-12' , 'YYYY-MM-DD'), -7 * 12 ) and T43161.trans_date between TO_DATE('2009-01-01' , 'YYYY-MM-DD') and TO_DATE('2009-01-31' , 'YYYY-MM-DD') )
group by T7120.VE_NAME
) D1,
(select sum(T44099.amnt_1) as c1,
sum(T44099.mk_1) as c2,
sum(T44099.qty_1) as c3,
T7120.VE_NAME as c4
from
EI04_TBL T44615 /* EI04_TBL 2 */ ,
VE04_TBL T7120,
GE04_COMPANY_TBL T43802,
Salesmcost T44099 /* Salesmcost_2 */
where ( T7120.VE_CODE = T44099.ve_code and T7120.VE_CODE = T44615.VE_CODE and T7120.GE_COMPANY_CODE = '1' and T43802.GE_COMPANY_CODE = T44099.ge_company_code and T43802.GE_COMPANY_NAME = '*** Φ. & Κ. ΛΕΜΟΝΗΣ ΑΕΒΕ ****' and T43802.LIST_ITEM_IND = '1' and T44099.ei_code = T44615.EI_CODE and T44615.GE_COMPANY_CODE = '1' and T44615.EI_SEASON_CODE = 'Χ' and T44615.EI_YEAR = '2008' and T44099.trans_date between TO_DATE('2008-01-01' , 'YYYY-MM-DD') and TO_DATE('2008-01-31' , 'YYYY-MM-DD') )
group by T7120.VE_NAME
) D2
where ( D1.c4 = D2.c4 ) /*<------- I think that this join creates the problem*/
order by c1
Edited by: user1198434 on 12 Μαϊ 2010 5:14 πμ
Edited by: user1198434 on 12 Μαϊ 2010 5:41 πμHi,
go through this
http://obiee101.blogspot.com/search/label/OUTER%20JOIN
I think you are new to the forum. try searching through some of the famous obiee forums. Gurus have already covered most of the issues. few are,
http://obiee101.blogspot.com
http://oraclebizint.wordpress.com/
http://gerardnico.com/weblog/
http://108obiee.blogspot.com/
thanks,
karthick -
TP Agreement Not Found -- OAGIS XML document over AS2
Hi,
I am getting TP Agreement not found error while receiving OAGIS XML document over AS2. Below is error message.
Agreement not found for trading partners: FromTP SOALocal, ToTP Powell with document type PROCESS_INVOICE_002-null-INBOUND
I am not sure why it says null-INBOUND. It appears like it is not able to identify Document Version. DOCTYPE_REVISION=7.2.1 is being passed in the AS2 transport headers but still it does not recognize the version.
I am not sure what is missing. Please give some ideas hints.
Below is the Business Message:----
Id AC12149513F1F78141400000E7DEDE00
Message Id AC12149513F1F78136200000E7DED800
Refer To Message Refer To Message
Sender Type AS2 Identifier
Sender Value SOALocal
Receiver Type AS2 Identifier
Receiver Value PowellIndustries
Sender SOALocal
Receiver Powell
Agreement Id
Agreement
Document Type PROCESS_INVOICE_002
Document Protocol OAG
Document Version 7.2.1
Message Type REQ
Direction INBOUND
State MSG_ERROR
Acknowledgement Mode NONE
Response Mode ASYNC
Send Time Stamp 06/07/2013 11:28:49 AM
Receive Time Stamp 06/07/2013 11:28:50 AM
Document Retry Interval(Channel) 0
Document Remaining Retry(Channel) 0
Document Retry Interval(Agreement)
Document Remaining Retry(Agreement)
Native Message Size 10788
Translated Message Size
Business Action Name
Business Transaction Name
Xpath Name1
Xpath Value1
Xpath Expression1
Xpath Name2
Xpath Value2
Xpath Expression2
Xpath Name3
Xpath Value3
Xpath Expression3
Correlation From XPath Name
Correlation From XPath Value
Correlation From XPath Expression
Correlation To XPath Name
Correlation To XPath Value
Correlation To XPath Expression
Wire Message Wire Message
Application Message Application Message
Payload Storage Payload Storage
Attachment Attachment
Label
Collaboration Id AC12149513F1F7813BF00000E7DEDB00
Collabration Name
Collabration Version
Business Action Name
Exchange Protocol Name AS2
Exchange Protocol Version 1.1
Interchange Control Number
Group Control Number
Transaction Set Control Number
Error Code B2B-50547
Error Description Machine Info: (pwl.pri) Agreement not found for trading partners: FromTP SOALocal, ToTP Powell with document type PROCESS_INVOICE_002-null-INBOUND.
Error Level ERROR_LEVEL_COLLABORATION
Error Severity ERROR
Error Text Agreement not found for trading partners: FromTP SOALocal, ToTP Powell with document type PROCESS_INVOICE_002-null-INBOUND.
Below is the Wire Message:----
Id AC12149513F1F78115400000E7DED600
Message Id AC12149513F1F78115400000E7DED600
Business Message AC12149513F1F78141400000E7DEDE00
Packed Message Packed Message
Payload Payload
Protocol Message Id <38383939373331343630313931303737@SOALocal>
Refer To Protocol Message Id
Protocol Collaboration Id
Protocol Transport Binding ChannelName=SOALocal dcID=CHANNEL_nlzbB-7511847722850817684 AS2-To=PowellIndustries DOCTYPE_NAME=PROCESS_INVOICE_002 TE=trailers, deflate, gzip, compress DOCTYPE_REVISION=7.2.1 Date=Fri, 07 Jun 2013 16:28:49 GMT AS2-Version=1.1 Accept-Encoding=gzip, x-gzip, compress, x-compress AS2-From=SOALocal url=http://pwl.pri/b2b/transportServlet Content-Transfer-Encoding=binary Message-ID=<38383939373331343630313931303737@SOALocal> Content-type=application/pkcs7-mime; smime-type="enveloped-data" MSG_RECEIVED_TIME=Fri Jun 07 11:28:49 CDT 2013 ECID-Context=1.71b9d2a41e5aaef0:-10db6371:13f1ee6cb74:-8000-000000000000276d;khvE MIME-version=1.0 tpName=PowellIndustries User-Agent=AS2 Server Oracle HTTPClient Version 10h Content-Length=13663 Host=pwl.pri:8001 Connection=close, TE useProxy=false From=SOALocal additionalHeaders=DOCTYPE_NAME=PROCESS_INVOICE_002#DOCTYPE_REVISION=7.2.1
Message Digest Message Digest
Digest Algorithm md5
Transport Protocol HTTP
Transport Protocol Version 1.1
Url http://pwl.pri:8001/b2b/transportServlet
security
Transport Headers ChannelName=SOALocal dcID=CHANNEL_nlzbB-7511847722850817684 AS2-To=PowellIndustries DOCTYPE_NAME=PROCESS_INVOICE_002 TE=trailers, deflate, gzip, compress DOCTYPE_REVISION=7.2.1 Date=Fri, 07 Jun 2013 16:28:49 GMT AS2-Version=1.1 Accept-Encoding=gzip, x-gzip, compress, x-compress AS2-From=SOALocal url=http://pwl.pri:8001/b2b/transportServlet Content-Transfer-Encoding=binary Message-ID=<38383939373331343630313931303737@SOALocal> Content-type=application/pkcs7-mime; smime-type="enveloped-data" MSG_RECEIVED_TIME=Fri Jun 07 11:28:49 CDT 2013 ECID-Context=1.71b9d2a41e5aaef0:-10db6371:13f1ee6cb74:-8000-000000000000276d;khvE MIME-version=1.0 tpName=PowellIndustries User-Agent=AS2 Server Oracle HTTPClient Version 10h Content-Length=13663 Host=pwl.pri:8001 Connection=close, TE useProxy=false From=SOALocal additionalHeaders=DOCTYPE_NAME=PROCESS_INVOICE_002#DOCTYPE_REVISION=7.2.1
certificates certificates
State ERROR
Reattempt Count
Error Code B2B-50547
Error Description Machine Info: (pwl.pri) Agreement not found for trading partners: FromTP SOALocal, ToTP Powell with document type PROCESS_INVOICE_002-null-INBOUND.
Error Text Agreement not found for trading partners: FromTP SOALocal, ToTP Powell with document type PROCESS_INVOICE_002-null-INBOUND.
exchangeRetryInterval
exchangeRemainingRetry
Message Size 10788
Thanks
Ismail M.Hi Anuj,
Here is the payload from the wire message. We are using 11.1.1.6.0
<?xml version = '1.0' encoding = 'UTF-8'?>
<PROCESS_INVOICE_002 xmlns="http://www.openapplications.org/171_process_invoice_002">
<CNTROLAREA xmlns="">
<BSR>
<VERB value="PROCESS">PROCESS</VERB>
<NOUN value="INVOICE">INVOICE</NOUN>
<REVISION value="002">002</REVISION>
</BSR>
<SENDER>
<LOGICALID>POWELLIND</LOGICALID>
<COMPONENT>B2B</COMPONENT>
<TASK/>
<REFERENCEID/>
<CONFIRMATION>0</CONFIRMATION>
<LANGUAGE>ENG</LANGUAGE>
<CODEPAGE/>
<AUTHID>oracle B2B</AUTHID>
</SENDER>
<DATETIME qualifier="CREATION">
<YEAR/>
<MONTH/>
<DAY/>
<HOUR/>
<MINUTE/>
<SECOND/>
<SUBSECOND/>
<TIMEZONE/>
</DATETIME>
</CNTROLAREA>
<DATAAREA xmlns="">
<PROCESS_INVOICE>
<INVHEADER>
<AMOUNT qualifier="DOCUMENT" type="T" index="1">
<VALUE>5413</VALUE>
<NUMOFDEC>2</NUMOFDEC>
<SIGN>+</SIGN>
<CURRENCY>USD</CURRENCY>
<DRCR>D</DRCR>
</AMOUNT>
<DATETIME qualifier="DOCUMENT" index="1">
<YEAR>2013</YEAR>
<MONTH>03</MONTH>
<DAY>15</DAY>
<HOUR>00</HOUR>
<MINUTE>00</MINUTE>
<SECOND>00</SECOND>
<SUBSECOND>0000</SUBSECOND>
<TIMEZONE>-0500</TIMEZONE>
</DATETIME>
<DOCUMENTID>1000182</DOCUMENTID>
<DESCRIPTN/>
<DOCTYPE/>
<PAYMETHOD/>
<REASONCODE/>
<USERAREA/>
<PARTNER>
<NAME index="1">Powell US Operating Unit</NAME>
<ONETIME/>
<PARTNRID/>
<PARTNRTYPE>Supplier</PARTNRTYPE>
<SYNCIND/>
<ACTIVE/>
<CURRENCY/>
<DESCRIPTN/>
<DUNSNUMBER/>
<GLENTITYS/>
<NAME index="1">Powell US Operating Unit</NAME>
<PARENTID/>
<PARTNRIDX/>
<PARTNRRATG/>
<PARTNRROLE/>
<PAYMETHOD/>
<TAXEXEMPT/>
<TAXID/>
<TERMID/>
<USERAREA/>
<CONTACT>
<NAME index="1">No Sales Credit</NAME>
<CONTCTTYPE/>
<DESCRIPTN/>
<EMAIL/>
<FAX index="1"/>
<TELEPHONE index="1"/>
<USERAREA/>
</CONTACT>
</PARTNER>
<PARTNER>
<NAME index="1">PO Box 843823, Dallas, Dallas, TX, 75284-3823, United States</NAME>
<ONETIME/>
<PARTNRID/>
<PARTNRTYPE>RemitTo</PARTNRTYPE>
<SYNCIND/>
<ACTIVE/>
<CURRENCY/>
<DESCRIPTN/>
<DUNSNUMBER/>
<GLENTITYS/>
<NAME index="1">PO Box 843823, Dallas, Dallas, TX, 75284-3823, United States</NAME>
<PARENTID/>
<PARTNRIDX/>
<PARTNRRATG/>
<PARTNRROLE/>
<PAYMETHOD/>
<TAXEXEMPT/>
<TAXID/>
<TERMID/>
<USERAREA/>
<ADDRESS>
<ADDRLINE index="1">PO Box 843823</ADDRLINE>
<ADDRTYPE/>
<CITY>Dallas</CITY>
<COUNTRY>United States</COUNTRY>
<COUNTY>Dallas</COUNTY>
<DESCRIPTN/>
<FAX index="1"/>
<POSTALCODE/>
<REGION/>
<STATEPROVN>TX</STATEPROVN>
<TAXJRSDCTN/>
<TELEPHONE index="1"/>
<URL/>
<USERAREA/>
</ADDRESS>
<CONTACT>
<NAME index="1"/>
<CONTCTTYPE/>
<DESCRIPTN/>
<EMAIL/>
<FAX index="1"/>
<TELEPHONE index="1"/>
<USERAREA/>
</CONTACT>
</PARTNER>
<PARTNER>
<NAME index="1"/>
<ONETIME/>
<PARTNRID/>
<PARTNRTYPE>Carrier</PARTNRTYPE>
<SYNCIND/>
<ACTIVE/>
<CURRENCY/>
<DESCRIPTN/>
<DUNSNUMBER/>
<GLENTITYS/>
<NAME index="1"/>
<PARENTID/>
<PARTNRIDX/>
<PARTNRRATG/>
<PARTNRROLE/>
<PAYMETHOD/>
<TAXEXEMPT/>
<TAXID/>
<TERMID/>
<USERAREA/>
<ADDRESS>
<ADDRLINE index="1"/>
<ADDRTYPE/>
<CITY/>
<COUNTRY/>
<COUNTY/>
<DESCRIPTN/>
<FAX index="1"/>
<POSTALCODE/>
<REGION/>
<STATEPROVN/>
<TAXJRSDCTN/>
<TELEPHONE index="1"/>
<URL/>
<USERAREA/>
</ADDRESS>
<CONTACT>
<NAME index="1"/>
<CONTCTTYPE/>
<DESCRIPTN/>
<EMAIL/>
<FAX index="1"/>
<TELEPHONE index="1"/>
<USERAREA/>
</CONTACT>
</PARTNER>
<DOCUMNTREF>
<DOCTYPE>INV</DOCTYPE>
<DOCUMENTID>10005:21009</DOCUMENTID>
<PARTNRID/>
<PARTNRTYPE>Supplier</PARTNRTYPE>
<DESCRIPTN/>
<DOCUMENTRV/>
<LINENUM/>
<NOTES index="1"/>
<SCHLINENUM/>
<SUBLINENUM/>
<USERAREA/>
</DOCUMNTREF>
<INVTAX>
<AMOUNT qualifier="TAX" type="T" index="1">
<VALUE>413</VALUE>
<NUMOFDEC>2</NUMOFDEC>
<SIGN>+</SIGN>
<CURRENCY>USD</CURRENCY>
<DRCR>D</DRCR>
</AMOUNT>
<AMOUNT qualifier="TAXBASE" type="T" index="1">
<VALUE>5413</VALUE>
<NUMOFDEC>2</NUMOFDEC>
<SIGN>+</SIGN>
<CURRENCY>USD</CURRENCY>
<DRCR>D</DRCR>
</AMOUNT>
<QUANTITY qualifier="PERCENT">
<VALUE/>
<NUMOFDEC/>
<SIGN/>
<UOM/>
</QUANTITY>
<DESCRIPTN/>
<LINENUM/>
<TAXCODE/>
<TAXJRSDCTN/>
<USERAREA/>
</INVTAX>
<PYMTTERM>
<AMOUNT qualifier="DISCNT" type="T" index="1">
<VALUE/>
<NUMOFDEC/>
<SIGN/>
<CURRENCY/>
<DRCR/>
</AMOUNT>
<DATETIME qualifier="DISCNT" index="1">
<YEAR/>
<MONTH/>
<DAY/>
<HOUR/>
<MINUTE/>
<SECOND/>
<SUBSECOND/>
<TIMEZONE/>
</DATETIME>
<DATETIME qualifier="DUE" index="1">
<YEAR>2013</YEAR>
<MONTH>04</MONTH>
<DAY>14</DAY>
<HOUR>00</HOUR>
<MINUTE>00</MINUTE>
<SECOND>00</SECOND>
<SUBSECOND>0000</SUBSECOND>
<TIMEZONE>-0500</TIMEZONE>
</DATETIME>
<DATETIME qualifier="PYMTTERM" index="1">
<YEAR>1952</YEAR>
<MONTH>01</MONTH>
<DAY>01</DAY>
<HOUR>00</HOUR>
<MINUTE>00</MINUTE>
<SECOND>00</SECOND>
<SUBSECOND>0000</SUBSECOND>
<TIMEZONE>-0600</TIMEZONE>
</DATETIME>
<DESCRIPTN>Net Due in 30 Days</DESCRIPTN>
<TERMID>30 NET</TERMID>
<USERAREA>
<AMOUNT qualifier="TOTAL" type="T" index="1">
<VALUE>5413</VALUE>
<NUMOFDEC>2</NUMOFDEC>
<SIGN>+</SIGN>
<CURRENCY/>
<DRCR>D</DRCR>
</AMOUNT>
</USERAREA>
</PYMTTERM>
</INVHEADER>
<INVLINE>
<AMOUNT qualifier="EXTENDED" type="T" index="1">
<VALUE>50</VALUE>
<NUMOFDEC/>
<SIGN>+</SIGN>
<CURRENCY/>
<DRCR>D</DRCR>
</AMOUNT>
<OPERAMT qualifier="UNIT" type="T">
<VALUE>5</VALUE>
<NUMOFDEC/>
<SIGN>+</SIGN>
<CURRENCY/>
<UOMVALUE>1</UOMVALUE>
<UOMNUMDEC>0</UOMNUMDEC>
<UOM/>
</OPERAMT>
<QUANTITY qualifier="ITEM">
<VALUE>10</VALUE>
<NUMOFDEC/>
<SIGN>+</SIGN>
<UOM/>
</QUANTITY>
<LINENUM>1</LINENUM>
<DESCRIPTN>11GA SHEET STEEL HOT ROLLED-PICKLED-OILED COMMERCIAL QUALITY.</DESCRIPTN>
<ITEM>11GA SHEET STEEL HOT ROLLED-PICKLED-OILED COMMERCIAL QUALITY.</ITEM>
<ITEMTYPE/>
<ITEMX>11HRPO</ITEMX>
<OPENITEM/>
<PROJACTVTY/>
<UNIT>LB</UNIT>
<UPC/>
<USERAREA/>
<DOCUMNTREF>
<DOCTYPE>LINE</DOCTYPE>
<DOCUMENTID>10005:21009:19019</DOCUMENTID>
<PARTNRID/>
<PARTNRTYPE>Supplier</PARTNRTYPE>
<DESCRIPTN/>
<USERAREA/>
</DOCUMNTREF>
<DOCUMNTREF>
<DOCTYPE>SalesOrder</DOCTYPE>
<DOCUMENTID>600813</DOCUMENTID>
<PARTNRID/>
<PARTNRTYPE/>
<DESCRIPTN/>
<USERAREA/>
</DOCUMNTREF>
<DOCUMNTREF>
<DOCTYPE>PurchaseOrder</DOCTYPE>
<DOCUMENTID>TEST123</DOCUMENTID>
<PARTNRID>N/A</PARTNRID>
<PARTNRTYPE>Customer</PARTNRTYPE>
<DESCRIPTN/>
<DOCUMENTRV/>
<LINENUM/>
<SCHLINENUM/>
</DOCUMNTREF>
</INVLINE>
</PROCESS_INVOICE>
</DATAAREA>
</PROCESS_INVOICE_002> -
how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet
Hello
For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
Also, take a look at FTP Browser.vi, which is available at the Example Finder.
To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
Post your current VI if possible.
Regards
Mondoni -
Receiving Custom XML Document over AS2 (HTTPS) - Inbound Processing
Hi All,
Need help in Receiving Custom XML Document over AS2 (HTTPS) - Inbound Processing
External Trading Partner will be able to post the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver.
Here is the process flow:
1. External Trading Partner will be posting the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver
2. B2B, consumes the Custom XML validates as per the XSD and process it.
3. How to send the ACK back to External Trading Partner if it validates successfully and sent it to 'IP_IN_QUEUE'
4. How to send the ACK back to External Trading Partner if the validation fails after receiving the XML document.
5. Does the External Trading Partner require any certificates to post the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver (no need of encryption/decryption)?
6. How to enable the B2B server to accept the HTTPS messages from the Trading Partner (no need of encryption/decryption).
Please let me know. Thanks In Advance.
Regards,
AmirineniHi Nandu, Ramesh,
We have done the set-ups for transmitting a Custom XML Document over HTTP1.1 in B2B.
Our Business Case is as follows:
1. Read the Flat File using BPEL File Adapter
2. Transform the Message in BPEL and send it to B2B
2. Based on the set-ups in B2B, we need to post the XML message to the folliwng URL:-
http://databridge.buy.datastream.net:5555/invoke/dsImport/receiveXML
In the B2B Set-Ups, I have done the following:
Business Protocol name: Custom Document over Internet
Exchange Protocol: AS
Document Protocol: Custom
Transport Protocol: HTTP-1.1
Host name : http://databridge.buy.datastream.net
Port: 5555
I have also deployed the agreement as well as the configuration. The issue that I am currently facing is when I select the configuration in WSIL browser in JDeveloper, I am getting the following error:
"Unable to get schema information for target".
Hence I am not able to map the message in BPEL and send it to B2B.
Could you please let me know the possible causes and if I am missing anything in the set-ups in B2B.
As always, your help and guidance is highly appreciated.
Thanks,
Dibya -
Converting Oracle XML Query Result in Java String by using XSU
Hi,
I have a problem by converting Oracle XML Query Result in Java
String by using XSU. I use XSU for Java.
For example:
String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
preise ps where match='"+args[0]+"'");
String datum1=datum;
I become the following error:
Prototyp.java:47: Incompatible type for declaration. Can't
convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
Can somebody tell me a method() for converting to solve my
problem??????
ThanksHmmm.. Pretty basic just look at the example:
OracleXMLQuery qry = new OracleXMLQuery(conn,"Select max(ps.datum) from preise ps where match='"+args[0]+"'");
String xmlString = qry.getXMLString();
Hi,
I have a problem by converting Oracle XML Query Result in Java
String by using XSU. I use XSU for Java.
For example:
String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
preise ps where match='"+args[0]+"'");
String datum1=datum;
I become the following error:
Prototyp.java:47: Incompatible type for declaration. Can't
convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
Can somebody tell me a method() for converting to solve my
problem??????
Thanks -
Query over an infoset made from two ODS
Hi SDN,
First time building a query over an infoset over ODS.
Am I correct to assume that all I need is columns for a standard report and that I do not need to have Free Chars and rows?
When I execute the query, I get the following message:
Internal error in program CL_RSDD_VCUBE and method GET_SID-8-
Please help.
Saf:Hi
Please let me know if ur error got resolved.I am also getting the same error .
Thanks In Advance -
How to tune the performance of Oracle SQL/XML query?
Hi all,
I am running Oracle 9i and like to run the following Oracle SQL/XML query. It takes about 3+ hour and still not finish. If I get rid all the XML stuffs it only take minutes to run. Does anybody know how to what's the reason of this slow and how to tune it?
SELECT XMLElement("CUSTOMER",
XMLForest(C_CUSTKEY "C_CUSTKEY", C_NAME "C_NAME", C_ADDRESS "C_ADDRESS", C_PHONE "C_PHONE", C_MKTSEGMENT "C_MKTSEGMENT", C_COMMENT "C_COMMENT"),
(SELECT XMLAgg(XMLElement("ORDERS",
XMLForest(O_ORDERKEY "O_ORDERKEY", O_CUSTKEY "O_CUSTKEY", O_ORDERSTATUS "O_ORDERSTATUS", O_ORDERPRIORITY "O_ORDERPRIORITY", O_CLERK "O_CLERK", O_COMMENT "O_COMMENT"),
(SELECT XMLAgg(XMLElement("LINEITEM",
XMLForest(L_ORDERKEY "L_ORDERKEY", L_RETURNFLAG "L_RETURNFLAG", L_LINESTATUS "L_LINESTATUS", L_SHIPINSTRUCT "L_SHIPINSTRUCT", L_SHIPMODE "L_SHIPMODE", L_COMMENT "L_COMMENT")
FROM LINEITEM
WHERE LINEITEM.L_ORDERKEY = ORDERS.O_ORDERKEY)
FROM ORDERS
WHERE ORDERS.O_CUSTKEY = CUSTOMER.C_CUSTKEY)
FROM CUSTOMER ;
Thanks very much in advance for your time,
Jinghao Liuajallen wrote:
Why not something more like
SELECT *
FROM fact1 l,
FULL OUTER JOIN fact1 d
ON l.company = d.company
AND l.transactiontypeid = 1
AND d.transactiontypeid = 2;
Because this is not an equivalent of the original query.
drop table t1 cascade constraints purge;
drop table t2 cascade constraints purge;
create table t1 as select rownum t1_id from dual connect by level <= 5;
create table t2 as select rownum+2 t2_id from dual connect by level <= 5;
select * from (select * from t1 where t1_id > 2) t1 full outer join t2 on (t1_id = t2_id);
select * from t1 full outer join t2 on (t1_id = t2_id and t1_id > 2);
T1_ID T2_ID
3 3
4 4
5 5
6
7
T1_ID T2_ID
1
2
3 3
4 4
5 5
6
7 -
How to perf tune Oracle SQL/XML query?
Hi all,
I am using Oracle 9i and like to run the following Oracle SQL/XML query. It takes about 3+ hour and still not finish. If I get rid all the XML stuffs it only take minutes to run. Does anybody know how to what's the reason of this slow and how to tune it?
SELECT XMLElement("CUSTOMER",
XMLForest(C_CUSTKEY "C_CUSTKEY", C_NAME "C_NAME", C_ADDRESS "C_ADDRESS", C_PHONE "C_PHONE", C_MKTSEGMENT "C_MKTSEGMENT", C_COMMENT "C_COMMENT"),
(SELECT XMLAgg(XMLElement("ORDERS",
XMLForest(O_ORDERKEY "O_ORDERKEY", O_CUSTKEY "O_CUSTKEY", O_ORDERSTATUS "O_ORDERSTATUS", O_ORDERPRIORITY "O_ORDERPRIORITY", O_CLERK "O_CLERK", O_COMMENT "O_COMMENT"),
(SELECT XMLAgg(XMLElement("LINEITEM",
XMLForest(L_ORDERKEY "L_ORDERKEY", L_RETURNFLAG "L_RETURNFLAG", L_LINESTATUS "L_LINESTATUS", L_SHIPINSTRUCT "L_SHIPINSTRUCT", L_SHIPMODE "L_SHIPMODE", L_COMMENT "L_COMMENT")
FROM LINEITEM
WHERE LINEITEM.L_ORDERKEY = ORDERS.O_ORDERKEY)
FROM ORDERS
WHERE ORDERS.O_CUSTKEY = CUSTOMER.C_CUSTKEY)
FROM CUSTOMER ;
Thanks very much in advance for your time,
Jinghao LiuPlease post this message at:
Forums Home » Oracle Technology Network (OTN) » Products » Database » XML DB -
I have troubles with my XML query. It returns to many results and double results.
My code
select xmlelement("test", XMLAgg(xmlelement("Customer", XmlAttributes(a.CUSTOMER_ID "cid"))),
XMLAgg(xmlelement("Account", xmlagg(xmlelement("Account", b.ACCOUNT_ID) ))),
XMLAgg(xmlelement("ServicePoint", xmlagg(xmlelement("sp", c.SPID) ))) ).extract('*').getstringval() xml
From DM_SERVICE_POINT c, DM_CUSTOMER a, DM_ACCOUNT b where a.CUSTOMER_ID = b.CUSTOMER_ID And a.CUSTOMER_ID=c.CUSTOMER_ID AND a.CUSTOMER_ID='15058'
group by a.CUSTOMER_ID
i have 1 customer id in the table dm_customer, 2 account_id 's that are linked to customer_id with a FK. DM_Servicepoint contains 6 rows that are linked to dm_customer with a FK.
My result is 1 result for customer, thats correct but account shows 12 results, where i expect 2 results
and Service point shows also 12 records where i expect 6 records.
There is no direct link between account and service point but both are linked to customer. Each customer can have 1 or 2 account And each customer can have 1 or many servicepoints.
Can you help me?
Message was edited by:
MarindaNow to see whether we can get this to work with XML....Turns out it's a lot easier than I thought it would be:
SQL> select dbms_xmlgen.getxml('select c.name
2 , cursor(select a.acctno, a.name
3 from my_accounts a
4 where a.cust_id = c.id ) as accounts
5 , cursor(select s.sp_ref
6 from my_service_points s
7 where s.cust_id = c.id ) as srv_points
8 from my_customers c
9 ') from dual
10 /
DBMS_XMLGEN.GETXML('SELECTC.NAME,CURSOR(SELECTA.ACCTNO,A.NAMEFROMMY_ACCOUNTSAWHE
<?xml version="1.0"?>
<ROWSET>
<ROW>
<NAME>APC</NAME>
<ACCOUNTS>
<ACCOUNTS_ROW>
<ACCTNO>900000</ACCTNO>
<NAME>No1 a/c</NAME>
</ACCOUNTS_ROW>
<ACCOUNTS_ROW>
<ACCTNO>900002</ACCTNO>
<NAME>Business</NAME>
</ACCOUNTS_ROW>
</ACCOUNTS>
<SRV_POINTS>
<SRV_POINTS_ROW>
<SP_REF>SP1</SP_REF>
</SRV_POINTS_ROW>
<SRV_POINTS_ROW>
<SP_REF>SP2</SP_REF>
</SRV_POINTS_ROW>
<SRV_POINTS_ROW>
<SP_REF>SP3</SP_REF>
</SRV_POINTS_ROW>
<SRV_POINTS_ROW>
<SP_REF>SP4</SP_REF>
</SRV_POINTS_ROW>
<SRV_POINTS_ROW>
<SP_REF>SP5</SP_REF>
</SRV_POINTS_ROW>
<SRV_POINTS_ROW>
<SP_REF>SP6</SP_REF>
</SRV_POINTS_ROW>
</SRV_POINTS>
</ROW>
<ROW>
<NAME>MARINDA</NAME>
<ACCOUNTS>
<ACCOUNTS_ROW>
<ACCTNO>900004</ACCTNO>
<NAME>Checking</NAME>
</ACCOUNTS_ROW>
</ACCOUNTS>
<SRV_POINTS>
<SRV_POINTS_ROW>
<SP_REF>SP7</SP_REF>
</SRV_POINTS_ROW>
<SRV_POINTS_ROW>
<SP_REF>SP8</SP_REF>
</SRV_POINTS_ROW>
</SRV_POINTS>
</ROW>
</ROWSET>
SQL> Obviously you'll need to do some smartening up of the tag names.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Hi All,
We are planning to send Custom XML Document over HTTP(AS2) to the Remote Trading Partner. The XML Document needs to be posted to a particular URL in the Remote Trading Partner Site.Here is the process flow:
1. The input application format file having the messages will be transformed to an XML message in BPEL.
2. Then as per the set-ups done in B2B, this particular XML message needs to be posted to a URL.
I went through the B2B User's Guide but could not find any documentation on how to set up Custom XML Document over HTTP(AS2).
Could you please share the documents/technical notes or link which I can refer to do the set-ups in B2B.
Please let me know. Thanks In Advance.
Regards,
DIbyaHi Nandu, Ramesh,
We have done the set-ups for transmitting a Custom XML Document over HTTP1.1 in B2B.
Our Business Case is as follows:
1. Read the Flat File using BPEL File Adapter
2. Transform the Message in BPEL and send it to B2B
2. Based on the set-ups in B2B, we need to post the XML message to the folliwng URL:-
http://databridge.buy.datastream.net:5555/invoke/dsImport/receiveXML
In the B2B Set-Ups, I have done the following:
Business Protocol name: Custom Document over Internet
Exchange Protocol: AS
Document Protocol: Custom
Transport Protocol: HTTP-1.1
Host name : http://databridge.buy.datastream.net
Port: 5555
I have also deployed the agreement as well as the configuration. The issue that I am currently facing is when I select the configuration in WSIL browser in JDeveloper, I am getting the following error:
"Unable to get schema information for target".
Hence I am not able to map the message in BPEL and send it to B2B.
Could you please let me know the possible causes and if I am missing anything in the set-ups in B2B.
As always, your help and guidance is highly appreciated.
Thanks,
Dibya
Maybe you are looking for
-
Office 2013 applications cannot be made to show the "Documents" folder when opening and saving files
(Windows Server 2012R2 and Windows 8.1 PRO) We are redirecting the user's "Documents" folder to the network (using Folder Redirection). The OS hides this fact however, and most applications simply see the "Documents" folder when opening or saving fil
-
Dear All while uploading patches component SAP_AP . an error occurred in import phase XPRA_EXECUTION. what should be done now as i stuck on this phase? Please help. Thanks, REgards, jiten Edited by: jiten singh on Mar 16, 2009 5:56 AM
-
Hello, I am having an aesthetic problem with my q10 that i just got today. I was entering some contacts into my phone when I realized that the ALT key is activated whenever I add phone numbers. When I first got the phone the ALT key did not light up
-
1.8 Dual G5 will not turn on
Hi all I was using my G5 and absentmindedly turned it off at the power switch rather than the Apple menu. Now when I turn it on, I just get the indicator light on and nothing happens when I press the power switch. I've disconnected everything. I have
-
when i post a sales order system wont allow, it displays posting is posible next peorid. How to close the period any bady replay my Q Thanks&Reegards Rakesh