XML multiple targets problem
there is an example in oracle warehouse builder user's guide how to load xml file into multiple tables (1:N relationship).
Let's have an xml file:
<orders>
<order>
<id>1</id>
<items>
<item>
<product>a</product>
</item>
</items>
</order>
</orders>
but what if one day you get an xml file where an order has no items:
<orders>
<order>
<id>10</id>
</order>
</orders>
I get an error message: ORA-20011: Error occurred while loading source XML document into the target database object XXX . Base exception: No rows to modify -- the row enclosing tag missing. Specify the correct row enclosing tag.
What I want is to load in order table one row, and no rows in items table.
The xsl for this small example that makes a problem looks like (the rest is like in oracle warehouse builder user's guide example in C appendix):
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ROWSET>
<xsl:for-each select="orders/order/items/item">
<ROW>
<ORDER_ID>
<xsl:value-of select="../../id"/>
</ORDER_ID>
<PRODUCT>
<xsl:value-of select="product"/>
</PRODUCT>
</ROW>
</xsl:for-each>
</ROWSET>
</xsl:template>
</xsl:stylesheet>
Sounds like you've missed some tag from the files.
For XML processing I would look at leveraging XDB, see the post here;
http://blogs.oracle.com/warehousebuilder/2007/09/leveraging_xdb.html
Cheers
David
Similar Messages
-
Multiple Target from an XML file problem
I've an XLM file from which I import (using a pluggable mapping generated from xml_etl_ulils) data into a table.
I need to execute some controls and log errors on these data.
I created a splitter to split correct data (and put them into the table) and bad data (to log).
However the generated mapping goes into an error because it tries to read 2 times the same XML data.
The only way I found is to put all data (good and bad) into a temporary table and then apply the splitter to move data from that table to the targets.
However that is not a clean solution because I need to have and manage 2 tables for each real table.
Any clever suggestion ?
Tks
TullioWhat is the exact error you get (what db version also), could you post a simplified version of the SQL which fails also? I have splitter based maps that successfully read from file via the XMLType(bfilename....) style code and insert into multiple targets, I did this on 11g though.
Cheers
David -
XML..: Problem getting the data in the XML-file..
I'm developing a flash-file for my customer to use when
displaying list of products he's selling.
His list of products is inside a XML-file and he want me to
display an overview of the products inside a datagrid, so when you
click on the product you're interested in the productinfo will be
displayed.
But.. I'm having problems grabbing the data I want as it
seems to me that I have to use the unik ID's for each products to
get the data I want. I've tried adding the unik ID-code to my
action script but it still won't work.
Here's a part of the XML-code:
<Tooldata>
<Store name="N/A" zipcode="0033450" city="N/A" url="N/A"
phone="N/A" fax="N/A" email="N/A">
<Tool unikID="5_0022" control="14" cmnd="update">
<Toolgroupe>Hammer</Toolgroupe>
<Brand>Knipps</Brand>
<Model>K55_Knipps</Model>
<Price>35€</Price>
<Weight>N/A</Weight>
<Soldout>0</Soldout>
<Color>Red/Black</Color>
<Images>
<Images image="5_0022.jpg" prioritet="1" gen_id="16"
desc="MainImage"/>
<Images image="5_0022_1.jpg" prioritet="2" gen_id="16"
desc="Image 1"/>
<Images image="5_0022_2.jpg" prioritet="3" gen_id="16"
desc="Image 2"/>
<Images image="5_0022_3.jpg" prioritet="4" gen_id="16"
desc="Image 3"/>
</Images>
Now, the code above is only one item/product. But there are
several proucts listed in the XML-file and I find it hard to get
the product and the product info that I want to be displayed.
Here's my action script:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("ToolData.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseBildata(xmlData);
function ParseTooldata(TooldataInput:XML):void {
trace("XML Output");
trace("------------------------");
trace(TooldataInput.Store);
If I want to trace the images I just write
"trace(TooldataInput.Store.Images);
But if I want to trace one unik tool it's impossible. Well,
maybe not impossible.. I just don't know how to do just that.
When you trace (TooldataInput.Store); you get all the tools
at that store. But how do I trace only one tool using the unikID??
Thanks a lot in advance!Ace,
When using E4X if you have multiple nodes at the same level
you should be able to access them as an XMLList. Looking at your
XML you should be able to access each <Tool> node as:
TooldataInput.Store.Tool[0];
TooldataInput.Store.Tool[1];
or as an entire list
TooldataInput.Store.children()
WL -
Loading Data to Multiple Targets in BI
Hi Experts,
I have one doubt regarding data load to multiple targets in BI. I explain clearly- the scenario is to load the data coming from one source system to multiple Data Targets in BI. Like in BW, we will just create multiple update rules from InfoSource to different targets. In InfoPackage maintenance screen, under Data Targets Tab, we will select the respective targets which we want to load and we run the InfoPackage, it will updates the data to all the selected targets in the infopacakge.
But in BI, how we will implement this scenario, bcoz here we need to create the individual DTPs, and there is no options to load the data simultenaously to multiple targets.
So, is there any solution to implement this scenario in BI, plz expalin.
Thnaks in Advance
Ragards
Ramakrishna KamurthyHi Dennis,
No worries at all. I've been trying different approaches and strangely it does seem to load data packages faster when going via an InfoSource. (I don't understand why). However, it doesn't want to do it parallel.
Whereas when I went loaded direct from the DataSource to DataSource, it processed data packages twice as slow but three at a time. The result being without the InfoSource was faster. This can be seen in the DTP Process Monitor and in SM50.
Both DTPs had the default setting in Settings for Batch Manager of 3 parallel processes.
Our batch queues in SM50 have not been blocked with other processes.
Has anyone else had problems with parallel processes when loading via an InfoSource?
Thanks
Adrian
P.S.
I think I've discovered two cases where InfoSource may bring performance improvements:
Filtering Records
Transformation A includes the common and more simplistic transformations. e.g Sets a flag "Relevant" for certain conditions being met.
Transformation B includes the complex transformations. At the beginning of B, you include a Start Routine that filters out records not marked "Relevant". That way it only does the complex work on relevant records.
Time Conversion
If your Data Source has Fiscal Period, but you wish your DataTarget to have Calendar Month, you need to write a routine to covert if you extract direct from DataSource to DataTarget.
Whereas, if the Fiscal Period is passed to an InfoSource, you can use Time conversions or formulas to convert Fiscal Period to Calendar Month in a transformation between InfoSource and DataSource
Edited by: Adrian Bell on Jul 31, 2008 9:33 AM -
Hello,
for our business process, we need to map a single source message to multiple target messages (of different message types).
The (ABAP)mapping takes care of this mapping, so I put a transformation step after my receiver step, that invokes this mapping.
What do I have to define after the transformation step: do I use a fork or a send-for-each-block or ... ? Since we're on SP15, can we use the "extended" option in the interface determination to facilitate our process ?
Thanks for your answers !
Kind regards,
FrederikHi,
What is the SP that you are using. If it is XI 3.0 and SP less than 14 then it is not possible. You need to use Abstract interface.
And why do you need Multimapping in the first place. You can do a simple mapping and in the receiver determination you can add more Business Server/System. Each Service/System you will have seprate IB interface and a separate Interface mapping.
Hope this solves your problem.
Thanks,
Prakash -
OEM12c Job - Run a SQL Script from a central location against multiple targets
Hi All:
I need to execute a SQL script that can be run as OEM Job against multiple targets from a single location so that the output csv files are all in that central location. My problem is that the sql script job documentation says "Make sure that the script file is installed in the appropriate location on all targets". Is anyone aware of a way I can do this so that the SQl script is executed from a location on my OMS console?
CheersHi
Create SQL job to run against on the server. Save those results (csv) file in local target. And crete one OS job, to collect all csv files into your OMS Console.
Regards
Krishnan -
Multiple target datalines to multiple sound cards
Is there any way to accomplish the following:
I have 4 distinct sound cards. I am using 4 distinct target datalines (1 dataline per 1 microphone input), each in a separate thread, to sample sound.
Let me start with this question, is this scenario even possible with the current implementation of Java Sound?
If the microphones are in a linear array, spaced evenly apart, I would expect to see the the sound at the last microphone arrive after the sound of the first microphone. However, this does not always occur. This leads me to believe that one or more of the threads reading the target datalines is being starved.
I've checked for buffer overflows as follows:
int internalBufferSize = tdl.getBufferSize();
if (internalBufferSize == tdl.available()) {
System.err.println("Buffer overflow detected!");
}I'm not getting any buffer overflow errors.
As an experiment, I've attempted to attach multiple target datalines to a single sound device. While that will work fine (i.e., Java doesn't complain), I notice that when I read the data from the target datalines, I'm only getting the data from one or the other lines, but NOT both at the same time. Even though this isn't the same scenario I proposed, is there something in the Java Sound implementation that will prevent one target dataline per sound device in a JVM?
I'm fairly new to Java Sound, and I'm at a complete loss. I've gotten the same solution to work in other languages, however, I need Java for this particular application.Markus00000 wrote:
In
/etc/modprobe.d/alsa.conf
I put
options snd-hda-intel index=0
options snd-usb-audio index=1
If you give your default sound card index 0 and your USB camera a higher index, it might work.
Thanks a lot. This indeed solved the problem.
jmak -
Batch Automap to Multiple Target Applications
Hello,
I've Googled and read through the admin guide but I'm still confused with this function. I have multiple target applications in one FDM application and I need to setup an automap function for all the target applications.
I would be very grateful if someone could answer the following questions and describe the process.
How do you set “AutoMapCorrect” location for multiple target applications since there are different dimensions in each application?
Do I have to add a suspense member for each dimension in every target application?
I’m not sure how to produce a report that will tell a user: Here are the automapped members of the outline that kicked-out during this run?
Any help is greatly appreciated.
Thanks!As far as your first 2 questions, I can not provide a lot of help, as I'm pretty sure the out of the box automapping works only for the default adapter but I'm not entirely sure on that. To the 3rd problem, I've implemented a little script and put a taskflow associated to it in menumaker. I've toned this down a bit so I may have missed something in the syntax, in my implementation, I also removed the records of the suspense mapping to help push the user to fix them on a timely basis and added some error trapping. This was done by changing select * to delete * from tDatamap.
strSQL = "Select * from tDatamap "
strSQL = strSQL & "Where SrcDesc = 'Auto Map Suspense'"
Set rs = DW.DataAccess.farsKeySet(strSQL)
If Not rs.bof And Not rs.eof Then
Do Until rs.eof
lngCounter = lngCounter + 1
strProblem = strProblem & rs.fields("srcKey") & vbcrlf
rs.movenext
Loop
rs.close
Set rs = Nothing
RES.PlngActionType = 2 '(See Enumeration: ScriptActionTypes)
RES.PstrActionValue = "The Following were the suspense Maps" & vbcrlf & strProblem
End Sub
Regards
JTF -
Exception in XML Parser (format problem?)
Hi Experts,
I am working on IDOC -> AS2 Configuration and the AS2 Configuration has the below structure
<RecordSet>
<Row1>
<row1 - field1>
<row1 - field2>
<row1 - field3>
</Row1>
<Row2>
<row2 - field1>
<row2 - field2>
<row2 - field3>
</Row2>
<Records>
<Record1>
<Record1-Field1>
<Record1-Field1>
<Record1-Field1>
</Record1>
<Record2>
<Record2-Field1>
<Record2-Field1>
<Record2-Field1>
</Record2>
</Records>
</RecordSet>
We are getting the expected Structure when we AS2 Receiver has the xml format. But while doing module development with the strctxml2Plain, we are getting the below error in RWB CC Monitoring.
Message processing failed. Cause: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException''; nested exception caused by: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException'
Any ideas, why this error we are getting.....
Thanks in advance,
Regards,
VasuHi Vasu,
Not in the Mapping of IR.
In BIC Mapping Designer you have to test with the standard Mappings by providing the sample file whether the Conversion is happening correctly or not.
You have to take the same input file that what ever you are having now.
So that it will say clearly what is the problem in converting the XMLto the required EDI Format...
Check whether you have any Date Format Values are comming from the input file.
Regards
Seshagiri -
Attempt to process file failed with Exception in XML Parser-format problem
Hi all,
Iam getting an unusual error in the J2EE stack in XI.
And the message is:
006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)' 2006-11-30 17:31:07 Error Exception caught by adapter framework: null 2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
My scenerio iam posting IDOC to a flat file with content conversion in the receiver side,the mapping got executed successfully and in the audit log i found that the error was after the 'Start converting XML document content to plain text'.
This means that error occured during content conversion of XML to the prescribed file format.
Can anyone suggest any better approach using which we may trace the junk data in IDoc. Manual adhoc approach could take time and is error prone.
Thanks in advance...
karunHi Bhavesh,
Thanks for the early reply. I checked the mapping and everything is fine and the output is also in valid XML format.
The audit log shows that the mapping got executed successfully and the error is after the step 'Start converting XML document content to plain text '. Is there any constraint in the file adapter regarding the message size for parsing.
2006-11-30 17:30:50 Success Transfer: "BIN" mode, size 2912595 bytes, character encoding -
2006-11-30 17:30:50 Success Start converting XML document content to plain text
2006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)'
2006-11-30 17:31:07 Error Exception caught by adapter framework: null
2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
2006-11-30 17:31:07 Success The asynchronous message was successfully scheduled to be delivered at Thu Nov 30 17:36:07 GMT 2006.
2006-11-30 17:31:07 Success The message status set to WAIT.
2006-11-30 17:31:08 Success Acknowledgement creation triggered for type: SystemErrorAck
2006-11-30 17:31:08 Success Acknowledgement sent successfully for type: SystemErrorAck
2006-11-30 17:36:08 Success Retrying to deliver message to the application. Retry: 1 -
Hi All
How to tackle this xml schema validation problem
i am using the sample code provided by ORacle technet for xml
schema validation in the Oracle database(817).
The sample code works perfectly fine.
Sample as provided by http://otn.oracle.com/tech/xml/xdk_sample/archive/xdksample_093001.zip.
It works fine for normal xml files validated against
xml schema (xsd)
but in this case my validation is failing . Can you let me know why
I have this main schema
Comany.xsd
===========
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.company.org"
xmlns="http://www.company.org"
elementFormDefault="qualified">
<xsd:include schemaLocation="Person.xsd"/>
<xsd:include schemaLocation="Product.xsd"/>
<xsd:element name="Company">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Person" type="PersonType" maxOccurs="unbounded"/>
<xsd:element name="Product" type="ProductType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
================
which includes the following 2 schemas
Product.xsd
============
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:complexType name="ProductType">
<xsd:sequence>
<xsd:element name="Type" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
==============
Person.xsd
===========
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="SSN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
=================
now when i try to validate a xml file against Company.xsd
it throws an error saying unable to find Person.xsd.
no protocol error
Now where do i place these 2 schemas(.xsd files) Person & product
so that the java schemavalidation program running inside Oracle
database can locate these files
Rgrds
SushantHi Jinyu
This is the java code loaded in the database using loadjava called by a wrapper oracle stored procedure
import oracle.xml.parser.schema.*;
import oracle.xml.parser.v2.*;
import java.net.*;
import java.io.*;
import org.w3c.dom.*;
import java.util.*;
import oracle.sql.CHAR;
import java.sql.SQLException;
public class SchemaUtil
public static String validation(CHAR xml, CHAR xsd)
throws Exception
//Build Schema Object
XSDBuilder builder = new XSDBuilder();
byte [] docbytes = xsd.getBytes();
ByteArrayInputStream in = new ByteArrayInputStream(docbytes);
XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
//Parse the input XML document with Schema Validation
docbytes = xml.getBytes();
in = new ByteArrayInputStream(docbytes);
DOMParser dp = new DOMParser();
// Set Schema Object for Validation
dp.setXMLSchema(schemadoc);
dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
dp.setPreserveWhitespace (true);
StringWriter sw = new StringWriter();
dp.setErrorStream (new PrintWriter(sw));
try
dp.parse (in);
sw.write("The input XML parsed without errors.\n");
catch (XMLParseException pe)
sw.write("Parser Exception: " + pe.getMessage());
catch (Exception e)
sw.write("NonParserException: " + e.getMessage());
return sw.toString();
This is the code i used initially for validating a xml file against single xml schema (.xsd) file
In the above code could u tell how to specify the second schema validation code for the incoming xml.
say i create another Schemadoc for the 2nd xml schema.
something like this with another parameter(CHAR xsd1) passing to the method
byte [] docbytes1 = xsd1.getBytes();
ByteArrayInputStream in1 = new ByteArrayInputStream(docbytes1);
XMLSchema schemadoc1 = (XMLSchema)builder.build(in1,null);
DOMParser dp = new DOMParser();
How to set for the 2nd xml schema validation in the above code or can i combine 2 xml schemas.
How to go about it
Rgrds
Sushant -
Multiple flat file in and multiple target tables
Hi,
How can we have multiple flat file into multiple targets.
I am trying to load data from multiple flat files into respective tables. But it gives error like
VLD-2411: Cannot handle two file structures
Make sure that only one file structure is used in a SQL*Loader map
Can anyone help.
Regards
Rakesh KumarI donot thing in one mapping you can take multiple sqlloader file.
If want to load data form multiple file use External table. -
Multiple Target Files as the number of times Item in source node
Hi all
I am new XI ,my scenario is File to File and my data type structures for source and target are as follows
Data type for source
Source
Header 1:unbound
Org 1:unbound
In declaration of target data type occurrence of all child nodes are 1:unbounded. And I have used it in Message type and in message mapping for my target message type occurrence is showing as 1:1.
My objective is to replicate this entire Target as the no of times the Item is occurring in source ie for multiple items in source I want multiple target files. For this I have mapped item node of source to Target(parent node). But in mapping test it is only displaying one Target structure for multiple nodes in source. Please Help me in solving this issueHi Satish,
Use Multi Mappings :
When you create message mapping change the occurence of target from 1 to unbounded. This will allow you to create multiple target structures.
Then map them accordingly as per your need and you can see multiple output in test.
Just you have to be more focused on the context and for that you have to go thro' the mapping documents.
Search related documents on SDN and go thro' them.
Regards,
Shri -
Multiple Target files as the item in source file
Hi all ,
I am new XI ,my scenario is File to File and my data type structures for source and target are as follows
_Data type for source: _
Source
Header 1:unbound
org 1:unbound
order 1:unbound
Item 1:unbound
itemno 1:unbound
matno 1:unbound
Data type for Target
Target
org 1:unbound
order 1:unbound
itemno 1:unbound
matno 1:unbound
In declaration of target data type occurrence of all child nodes are 1:unbounded. And I have used it in Message type and in message mapping for my target message type occurrence is showing as 1:1.
My objective is to replicate this entire Target as the no of times the Item is occurring in source ie for multiple items in source I want multiple target files. For this I have mapped item node of source to Target(parent node). But in mapping test it is only displaying one Target structure for multiple nodes in source. Please Help me in solving this issue .
Full Points will be awarded
Thanks & Regards
Satish.Hi,
If you want multiple Targerts you need to use UseOneAsMany.
check below link
http://help.sap.com/saphelp_nw70/helpdata/en/38/85b142fa26c811e10000000a1550b0/content.htm
Thanks,
RamuV -
1 Success Caption for Multiple Targets in a Drag and Drop Interaction
I see how I can add success captions to each target in a drag and drop interaction, but can you apply only 1 success caption multiple targets?
The boundaries of smartshapes were overlapping with each other. For example, the smartshape on 1st line was overlapping with the one on 2nd line. Due to this, every time you place the text caption "Investment" on the smartshape on 2nd line, it automatically moved to the smartshape on 1st line. As a result, you could never get the answer right, and hence you never saw the Success Caption.
Solution: Move the smartshapes away from each other (or resize them), and ensure that there are no overlaps.
2, The number of attempts for this interaction was set to Infinite. So, you have to play this until you get it right, but you could not get it right because of the reasons mention above. That is why you never saw the Failure Caption.
Solution: Clear the Infinite check box in the Action accordion and specify the required number of attempts. You will get the Failure Caption if you don't get it right in those attempts.
I just tested these solutions and they worked fine. Let me know if you still face any issues.
Maybe you are looking for
-
SAP ECC6 memory and paging issues
Dear Experts I have recently upgraded my 4.6C systems to an ECC 6 system (DB2 LUW 9.5 on AIX 5.3 TL9 64 Bit OS) I have been running the LPAR with 14 GB of memory and we are around 100-200+ users using the system, I was monitoring using nmon and found
-
I have a large iPhoto library (about 130,000+ images). Recently I added a whole lot from another Library, and now I have a smattering of many grey'ed out "palm tree" images, like events, only just showing drawings of palm trees. I think the photo i
-
Illustrator CC Crashes on startup Win 8.1 with plugins
Happens every time I try to start and then crashes. Have Dell XPS with Win 8.1/
-
Hi, I just bought an Apple TV (gen. 3). But I seem to have some problems with the sound. It is connected to my TV through HDMI and I have a speaker set connected directly to my TV. The problem is that the sound is distorted and the bass is all wrong.
-
Hi, I have a form in JSF where I add a record to a database. When the user clicks add, a form appers with the input fields and two buttons add and cancel. The add button calls the action handler and adds the record to the database while the cancel re