CreateView (join) question, deep XML PO example
I'm trying to create a database view that makes the data from the PO example available via SQL. Recall that the PO example has a deep XML structure (header and POLINES) which is parsed into two objects PO and POLINES. PO is a child of PublicObjects, and I've sucessfully created a view on just it. Now I want to have a view that joins the header to the lines. POLINES object is a child of APPLICATIONOBJECT.
When I try to setup the JoinQualification, I get
Exception :oracle.ifs.common.IfsException: IFS-22701: PURCHASEORDERLINEITEM is not an alias or className
oracle.ifs.common.IfsException: IFS-22701: PURCHASEORDERLINEITEM is not an alias or className
Well gee, I thought it was.
Help?
For anyone else trying to do this... I switched to trying to join to the "Rejection" object. The mistake was that I was trying to join PurchaseOrder to Rejection, without including Rejection in the Search:
scp.addSearchClass("PURCHASEORDERREJECTION");
null
Similar Messages
-
CBO (optimizer) nest-loop join question
OS: Red Hat Linux
DB: 11gR1
I have gotten two conflicting answers while reading books by Don Burleson and Dan Hotka. It has to do with the CBO and nested-joins:
One says the CBO will choose the 'smaller' table as the driving table, the other states that the 'larger' table will be the driving table. And both stick by this philosophy as the preferred goal of any SQL Tuning -- that is, one states that the 'smaller' table should be the driving table. The other says the 'larger' table should be the driving table.
I had always thought that the 'smaller' table should be the driving table. That in a nested loop the driving will not likely use an index even. Who is correct? (I am not going to say who said what, btw). :-)
But I got to let one of them know they got a 'typo' ... :-)
Thx.user601798 wrote:
It is an over-simplistic scenario but, as I mentioned, if all other things are 'equal' -- which would include 'access time/work', then I think the small table as the driving table has the advantage.
It is not possible for +"*all* other things to be equal"+. (my emphasis).
If by +'access time/work'+ you mean the total is the same then it doesn't matter which table is first, the time/work is the same either way round.
If you want to say that the +'access time/work'+ for acquiring the first rowsource is the same for both paths, and the +'access time/work'+ for acquiring related rows from the second table is the same FOR EACH DRIVING ROW, then the total +'access time/work'+ will be difference, and it would be better to start with the smaller table. (The example by Salman Qureshi above: Re: CBO (optimizer) nest-loop join question would apply.)
On the other hand, and ignoring any idea of "all other things being equal", smaller tables tend to have smaller indexes, so if your smaller rowsource comes from a smaller table then acquiring those rows may be cheaper than acquiring rows from a larger table - which leads to the observation that (even with perfectly precise indexing):
<ul>
smaller number of rows * larger unit cost to find related rows
</ul>
may produce a larger value than
<ul>
larger number of rows * smaller unit cost to find related rows
</ul>
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
A general reminder about "Forum Etiquette / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718
If you never mark your questions as answered people will eventually decide that it's not worth trying to answer you because they will never know whether or not their answer has been of any use, or whether you even bothered to read it.
It is also important to mark answers that you thought helpful - again it lets other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching the same question, moreover it means that when you mark a bad or wrong answer as helpful someone may be prompted to tell you (and the rest of the forum) what's so bad or wrong about the answer you found helpful. -
Need to join the two xml type output in plsql function
Hi,
I need to join the two xml type output in plsql function. Could you help me out?
Sample function:
function func_ret_stk return xmtype
xmloutput_stk xmtype;
xmloutput_desp xmtype;
begin
xmloutput_stk := --------;
xmloutput_desp :=---------;
return xmloutput_stk + xmloutput_desp;
end ;
Thanks in Advance,Hello,
this is the forum for the tool {forum:id=260}.
Please ask your question in {forum:id=157} or {forum:id=34}
Regards
Marcus -
Hello World XML/XSL example not working in IE
I am trying to get the "Hello World" XML/XSL example to work in IE.
Could anyone help me out?
The code follows:
hello.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="hello.xsl"?>
<hello-world>
<greeter>An XSLT Programmer</greeter>
<greeting>Hello, World!</greeting>
</hello-world>
hello.xsl
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/hello-world">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<H1><xsl:value-of select="greeting"/></H1>
<xsl:apply-templates select="greeter"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="greeter">
<DIV>from
<I><xsl:value-of select="."/></I>
</DIV>
</xsl:template>
</xsl:stylesheet>
Both files are in the same directory.
When hello.xml is opened in IE, the output displayed is just, "from".
What's wrong, and where?
Please help!
- Edwin.Hi edwinwaz,
In response to your question, pls refer to this url
http://www.w3schools.com/xsl/el_template.asp
and take a look at the "note" in red.
It says that IE5.X have non-standard behavior on the element <xsl:template>
In addition, I have tested your code it works fine.
Just to add something on your code here.
I noticed that you do this
<xsl:apply-templates select="greeter"/>
and then in another template you do this
<xsl:template match="greeter">
<!-- code -->
</xsl:template>
In this case, it does work because "greeter" is a top-level element but if "greeter" is anything underneath the top-level element. It won't work.
Actually, I discovered this after taking a look at your example and
I was surprised that the code above worked and then I did some testing and discovered this.
I am learning XML too now... So, I am happy to know this :).
regards -
How to map a deep xml structure to flat structure
Hi, I'm trying to map a deep xml structure to a flat file structure. See this:
<SalesPoint>
<header>
<idTx></idTx>
<opCode></opCode>
</header>
<body>
<DataSet>
<codOperacion></codOperacion>
<codCanalDeVenta></codCanalDeVenta>
<cuitDeposito>
<docMinorista>
<fechaOperacion>
<codCC>
<Details>
<Dato>
<nroSerieEquipo></nroSerieEquipo>
<codNMU></codNMU>
<codOrigenEquipo></codOrigenEquipo>
<codConcepto></codConcepto>
<codSegmento></codSegmento>
<motivoSiniestro></motivoSiniestro>
</Dato>
</Details>
</DataSet>
</body>
</SalesPoint>
to:
<SalesPoint>
<idTx></idTx>
<opCode></opCode>
<codOperacion></codOperacion>
<codCanalDeVenta></codCanalDeVenta>
<cuitDeposito></cuitDeposito>
<docMinorista></docMinorista>
<fechaOperacion></fechaOperacion>
<codCC></codCC>
<nroSerieEquipo></nroSerieEquipo>
<codNMU></codNMU>
<codOrigenEquipo></codOrigenEquipo>
<codConcepto></codConcepto>
<codSegmento></codSegmento>
<motivoSiniestro></motivoSiniestro>
</SalesPoint>
Thanks in advance!!!!I do not think this is a complex XML structure. All that you need to take care is about the contexts. How ever it is not possible to give u the complete mapping here. If you have tried mapping already and facing some issues.. please put it here.. so that some one can help you.
VJ -
Simple XML DOM Example Needed.
I need a simple XML DOM Example that reads in the XML and makes objects out of the elements. The tutorial from sun is very sketchy and seems to good far too quickly.
Thanks,
Dave.You can find some examples:
http://java.sun.com/xml/jaxp/dist/1.0.1/examples/#building
http://newinstance.com/writing/javaxml2/javaxml2_examples.html
http://www.docuverse.com/domsdk/index.html#tutorial
http://www.devx.com/sourcebank/search.asp -
Export Question Slides XML to Moodle
I have several quizzes built in captivate 3 that i want to
export the questions as xml and then import them to moodle using
xml. I know i can run a scorm package on moodle with my quiz, but
i'm trying to actually use my questions as part of a moodle quiz so
i need to be able to import them as XML. when i just export my
captivate quiz as XML and then try the import Moodle XML function i
get errors. Any ideas?
Thanks,
DaveThanks so much for your help so far, Paul
Everything works great, except when trying to use the Export button from Reader. (It works as expected in Pro)
The file has been reader extended, so save works, but our developers need the ability to click that Export button from Reader and get an XML file. Any ideas if this is possible or how the code can be tweaked so it will work for Reader?
Thanks! -
Since I am not having any luck on the Java & XML forum (http://forum.java.sun.com/thread.jsp?forum=34&thread=512728&tstart=0&trange=15)
I thought I would try here. Does anyone know of a good example on the web they can point me to that shows XML-RPC with servlets as I cannot find any and the examples dir from the Apache distribution of XML-RPC (which is supposed to have such an example) is MIA. Thanks.hello,
I am looking for the same servlet xml-rpc example, Have you found it ?
nojkan -
Merge Join Cartesian in XML query
Hi Sir
I am getting Merge join cartesian in the below XML query
SELECT
x.empno,
x1.empno AS INDEXempno
FROM
emp_vw x,
emp_index x1,
table (xmlsequence(extract(x1.xml_data,'/emp/org/constituent/'))) c
WHERE x.empno = extractvalue(VALUE(c),'/constituent/code/text()');
I am getting Merge join cartesian in XML query. whereeas below query i am running by I am not getting merge join cartesian
SELECT
x.empno,
x1.empno AS INDEXempno
FROM
emp_vw_v6 x,
emp_index_v6 x1,
table (xmlsequence(extract(x1.xml_data,'/emp/org/constituent/'))) c
WHERE x.empno = extractvalue(VALUE(c),'/constituent/code/text()');
Here emp_vw is a view and emp_index is a table.This is not giving merge join cartesian
However both the view and table are interdependent.
Please help me to resolve the performance of the first query as it is taking a lot of time to execute.?
Thanks & Regards
Thakur Manoj RPlease post a working test case, and follow the guidelines here : {message:id=9360002}
What are the differences between the view and table in the first query and the two others (*_v6) in the second query? -
I need help with a question regarding XML
I have an exam tomorrow, and I was checking exams from previous years. There is a multiple choice question regarding XML, and I don't know all the correct answers (some are pretty obvious).
It's plattform independent
It allows UML representation
It's a Text Only format
It's faster to process than native binary formats
It's a data exchange standard
It allows specification of the meaning of the data in the document
It comes from HTML
.NET and J2EE provide tools to handle itIn the beginning there was SGML... the newest HTML
standard is an XML defined language (although most
sites and pages are still not XML compliant). Soyou
can think of HTML as a subset of XML but XML isnot
by any means a subset of HTML.But wasn't XML's format based on the original HTML?
That is, XML is a generalization of the original
HTML. So, the "true"/"false" determination depends
on how you define "It comes from HTML" (I thought it
was derived from HTML, which would make the
statement "true" [IMHO], but I could be wrong).No XML is not derived from HTML. Markup languages existed well before HTML. HTML popularized them to a large extent but it was not the first by any means.
See http://en.wikipedia.org/wiki/Generalized_Markup_Language
Also Wiki states in it's XML article that XML is a subset of SGML (which through that article) is a descendent of GML
The language heirarchy from SGML is as follows
SGML ---- HTML (old spec and deprecated)
|
|
----- XML ----- XHTML (current XML spec)edit: the tree got screwed up. XML descends from SGML directly.
Message was edited by:
cotton.m -
Where can I find XML component examples ?
where can I find XML components examples ?
Here are a couple video tutorials using XML with Flash:
http://www.gotoandlearn.com/play?id=64
http://www.gotoandlearn.com/play?id=65
Don't know if they're what you're looking for but worth a
look. -
Joining 2 different xml documents
Hi,
I have 2 different xml documents coming from different sources and i want to join the second document inside the first document root.How could i do??
Any example will be appreciated!!
Here is the example data:::
XML DOCUMENT(1)
<PopularModels>
<Manufacturer Make="Nokia"/>
</PopularModels>
XML DOCUMENT(2)
<Device>
<Price value="100"/>
</Device>
I want to join as follows:
<PopularModels>
<Manufacturer Make="Nokia"/>
<Device>
<Price value="100"/>
</Device>
</PopularModels>
nullHere is an example XSL file only for your example data, please modify to meet your further requirements.
<?xsl version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="ex" select="document('try02.xml')"/>
<xsl:template match="/">
<xsl:for-each select="PopularModels/child::*">
<xsl:copy-of select="."/>
</xsl:for-each>
<xsl:for-each select="$ex/child::*">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Hope this will help.
null -
JOIN question... Join two tables without omiting rows
I ran into a problem that should have an easy solution (I hope), but I'm having a hard time coming up with a solution.
Basically, I have two tables, one with actual amounts and one with the budget. I am to write a sql select statement that joins these tables together and includes all of their rows. I've been able to join the tables together using JOIN, LEFT JOIN, and RIGHT JOIN, but it always omits rows that I need.
Below, I have examples of my tables (AMOUNT_TABLE and BUDGET_TABLE). For simplicity sake, I've built the examples to show the same values in the first four columns, with the 5th and 6th columns (SUB_ACCOUNT, AMOUNT, BUDGET) as the only values that are different. My actual tables aren't quite as simple, but I didn't think it was relavent for this question.
AMOUNT_TABLE
FISCAL_YEAR
PERIOD
ACCT_UNIT
ACCOUNT
SUB_ACCOUNT
AMOUNT
2013
1
11111
555555
0000
100
2013
1
11111
555555
1000
100
2013
1
11111
555555
2000
100
2013
1
11111
555555
3000
100
2013
1
11111
555555
4000
100
BUDGET_TABLE
FISCAL_YEAR
PERIOD
ACCT_UNIT
ACCOUNT
SUB_ACCOUNT
BUDGET
2013
1
11111
555555
3000
200
2013
1
11111
555555
4000
200
2013
1
11111
555555
5000
200
2013
1
11111
555555
6000
200
Here is the output I'm hoping for. Notice that SUB_ACCOUNTs 0000, 1000, and 2000 show amounts with no budget since there isn't a matching row in the BUDGET_TABLE. And likewise, for SUB_ACCOUNTs 5000 and 6000, they show budgets with no amounts since there isn't a matching row in the AMOUNT_TABLE.
(output)
FISCAL_YEAR
PERIOD
ACCT_UNIT
ACCOUNT
SUB_ACCOUNT
AMOUNT
BUDGET
2013
1
11111
555555
0000
100
0
2013
1
11111
555555
1000
100
0
2013
1
11111
555555
2000
100
0
2013
1
11111
555555
3000
100
200
2013
1
11111
555555
4000
100
200
2013
1
11111
555555
5000
0
200
2013
1
11111
555555
6000
0
200
Hopefully, my question is clear. Any help on this would be greatly appreciated. Thanks in advance.Use ANSI join syntax - FULL OUTER JOIN:
with amount_table as (
select 2013 fiscal_year,1 period,11111 acct_unit,555555 account,0000 sub_account,100 amount from dual union all
select 2013,1,11111,555555,1000,100 from dual union all
select 2013,1,11111,555555,2000,100 from dual union all
select 2013,1,11111,555555,3000,100 from dual union all
select 2013,1,11111,555555,4000,100 from dual
budget_table as (
select 2013 fiscal_year,1 period,11111 acct_unit,555555 account,3000 sub_account,200 budget from dual union all
select 2013,1,11111,555555,4000,200 from dual union all
select 2013,1,11111,555555,5000,200 from dual union all
select 2013,1,11111,555555,6000,200 from dual
select nvl(a.fiscal_year,b.fiscal_year) fiscal_year,
nvl(a.period,b.period) period,
nvl(a.acct_unit,b.acct_unit) acct_unit,
nvl(a.account,b.account) account,
nvl(a.sub_account,b.sub_account) sub_account,
nvl(a.amount,0) amount,
nvl(b.budget,0) budget
from amount_table a
full join
budget_table b
on (
a.fiscal_year = b.fiscal_year
and
a.period = b.period
and
a.acct_unit = b.acct_unit
and
a.account = b.account
and
a.sub_account = b.sub_account
FISCAL_YEAR PERIOD ACCT_UNIT ACCOUNT SUB_ACCOUNT AMOUNT BUDGET
2013 1 11111 555555 0 100 0
2013 1 11111 555555 1000 100 0
2013 1 11111 555555 2000 100 0
2013 1 11111 555555 3000 100 200
2013 1 11111 555555 4000 100 200
2013 1 11111 555555 6000 0 200
2013 1 11111 555555 5000 0 200
7 rows selected.
SQL>
SY. -
Complex query/join question
Not sure if this goes here, but I thought I'd try anyway.
I'm using Oracle 8i for a legacy app and the RDBMS won't be updated anytime soon. I'm trying to write a fairly complex sum and join query. I have two different tables with hours worked type information. I need to be able to sum the hours for a work day on each table and put, in a web table like a GridView, all rows, even if there isn't a match in the opposite table. So, for example
Table 1
ID SHOP WORKDATE SHOPHOURS
1 AM1 1/1/2008 4
1 AM1 1/1/2008 4
2 AM1 1/1/2008 8
3 AM1 1/1/2008 8
Table 2
ID WORKDATE PAYHOURS
2 1/1/2008 7
3 1/1/2008 8
4 1/1/2008 9
What I need to see is
ID SHOP WORKDATE SHOPHOURS PAYHOURS
1 AM1 1/1/2008 8 0
2 AM1 1/1/2008 8 7
3 AM1 1/1/2008 8 8
4 1/1/2008 8 9
Since i'm on 8i, I can't use a FULL OUTER Join, so i'm kind of stumped. Any suggestions would be greatly appreciated.You might want to post this to question to [SQL Forum|http://forums.oracle.com/forums/forum.jspa?forumID=75] instead for better result, but i can give you a solution. This is definitely not the best solution, but it works.
select nvl(table1.id,table2.id) id, shop,
nvl(table1.workdate,table2.workdate) workdate,
sum(nvl(shophours,0)) shophours, sum(nvl(payhours,0)) payhours
from table1, table2 where table1.id(+) = table2.id
group by nvl(table1.id,table2.id), shop,
nvl(table1.workdate,table2.workdate)
union
select nvl(table1.id,table2.id) id, shop,
nvl(table1.workdate,table2.workdate) workdate,
sum(nvl(shophours,0)) shophours, sum(nvl(payhours,0)) payhours
from table1, table2 where table1.id = table2.id(+)
group by nvl(table1.id,table2.id), shop,
nvl(table1.workdate,table2.workdate) Cheers,
[Nur Hidayat|http://nur-hidayat.net] -
Question about XML validation against schema
My question is probably a basic one about XML. I tried PurchaseOrder example from the book "J2EE Web Services" by Richard Monson-Haefel. A simplified version as followings -
Address.xsd -
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/Address"
xmlns:addr="http://xml.netbeans.org/schema/Address"
elementFormDefault="qualified">
<element name="address" type="addr:USAddress" />
<complexType name="USAddress">
<sequence>
<element name="name" type="string" />
<element name="street" type="string" />
<element name="city" type="string" />
<element name="state" type="string" />
<element name="zip" type="string" />
</sequence>
</complexType>
</schema>
PurchaseOrder.xsd -
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/PurchaseOrder"
xmlns:po="http://xml.netbeans.org/schema/PurchaseOrder"
xmlns:ad="http://xml.netbeans.org/schema/Address"
elementFormDefault="qualified">
<import namespace="http://xml.netbeans.org/schema/Address" schemaLocation="Address.xsd" />
<element name="purchaseOrder" type="po:PurchaseOrder" />
<complexType name="PurchaseOrder">
<sequence>
<element name="accountName" type="string" />
<element name="accountNumber" type="unsignedShort" />
<element name="shipAddress" type="ad:USAddress" />
<element name="total" type="float" />
</sequence>
<attribute name="orderDate" type="date" />
</complexType>
</schema>
Then PurchaseOrder.xml is -
<purchaseOrder orderDate="2007-12-12"
xmlns='http://xml.netbeans.org/schema/PurchaseOrder'
xmlns:addr="http://xml.netbeans.org/schema/Address"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://xml.netbeans.org/schema/PurchaseOrder ../xsd/PurchaseOrder.xsd'>
<accountName>Starwood</accountName>
<accountNumber>220</accountNumber>
<shipAddress>
<name>Data Center</name>
<street>1501 Washington St.</street>
<city>Braintree</city>
<state>MA</state>
<zip>02148</zip>
</shipAddress>
<total>250</total>
</purchaseOrder>
Then I did a XML validation but have this error -
cvc-complex-type.2.4.a: Invalid content was found starting with element 'name'. One of '{"http://xml.netbeans.org/schema/Address":name}' is expected. [19]
It complains <name> tag in <shipAddrss> needs namespace of "http://xml.netbeans.org/schema/Address". Why?
Is it possible to change XML so it does not need name space for elements inside <shipAddress>?
ThanksHi Madhura,
see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
NOK - Validation error
Elapsed time: 16353 ms
C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
NOK - Validation error
Elapsed time: 994 ms
Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
The W3C servers are slow to return DTDs. Is the delay intentional?
Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
--> They don't want to have requests to their site from productive servers all around the world.
Regards,
Rüdiger
Maybe you are looking for
-
[SOLVED]problem with Bumblebee and Kernel 3.11-1-2
Hi! I'm having problems with Bumblebee from Kernel 3.10 but I read that Kernel 3.11 solved the problem, I searched and tried possible solutions to my problem unsuccessfully The message shows me when I run "optirun": [ 5454.262739] [ERROR]Cannot acces
-
Just got 3rd generation Apple TV - does anyone know how to get Aperture photos to show up? I've set up home sharing
-
Outbound caller ID work around
We have CM5.CCX 5 Customer is asking if he has 37 markets to outpost the local area market caller id. CM can only outpost 1 DID. Is there any work around for this. He has 37 locations and they now call 800 and connect to call center. He wants his age
-
Can I buy a DVD disc for Lightroom 5 that also includes any upgrades since it came out?
Can I buy a DVD disc of Lightroom5 that includes any upgrades since it came out?
-
Audio lost when converting from standard to widescreen
I have been working on an iMovie project for about two weeks and just noticed that there was an option for widescreen vs standard mode. I read through the instructions and it said that one can convert to widescreen at any time in a project. I conve