DairylandDan
Programmer
Hey Folks,
I'm finding myself in a double tight spot, and so, I'm coming to the one site where I know I can always get assistance. Due to company shuffles and a dead-line, I'm working on a project which is not in my area of expertise. My background is SQL Server - this project is Oracle 10g Release 2 attempting to utilize XSU. I'm living in the training manuals - but, I'm still a little unsure about quite a few things . . . but, I'll start with just my immediate situation --> Differing structure between the XML elements and the table field names. (again, I come from the SQL Server universe - so please forgive me if my terminology is incorrect.)
For this example let's call the table (is the correct term in the oracle universe 'SID'?): 'table1' and let's say that I have three fields (columns in oracle?): 'field1' and 'field2', 'field3', and (I realize that this will be totally unexpected) 'field4'. <g>
OK, from the XML document I have the following four elements:
Alright, so, here's where I'm lost . . .
First: By reading the manual ( I see that i need to create a view of the table ('table1') where I can reference the fields ('field1', 'field2', etc) with the column alias 'AS' so that the fields match with the expected xml elements. Now, with the first two xml elements, they both end up being '<ID>' . . . and I'm pretty sure that I can't alias two different fields ('field1' & 'field2') as the same ('AS ID' for both of them). So, how do I rectify this?
Second: How do I relate the third xml element example (with attributes of 'qualifier' and 'type') to a field (‘field3’)? For example, there are multiple '<AMOUNT' elements with different attributes - so, I need to differentiate between those.
Third: How do I combine the multiple elements in the fourth xml element example (year, month, day) into a single field (‘field4’)?
Whew! OK, I know there’s quite a bit here . . . but, I’d appreciate any and all input/assistance. You all rock!
DD
I'm finding myself in a double tight spot, and so, I'm coming to the one site where I know I can always get assistance. Due to company shuffles and a dead-line, I'm working on a project which is not in my area of expertise. My background is SQL Server - this project is Oracle 10g Release 2 attempting to utilize XSU. I'm living in the training manuals - but, I'm still a little unsure about quite a few things . . . but, I'll start with just my immediate situation --> Differing structure between the XML elements and the table field names. (again, I come from the SQL Server universe - so please forgive me if my terminology is incorrect.)
For this example let's call the table (is the correct term in the oracle universe 'SID'?): 'table1' and let's say that I have three fields (columns in oracle?): 'field1' and 'field2', 'field3', and (I realize that this will be totally unexpected) 'field4'. <g>
OK, from the XML document I have the following four elements:
Code:
<VOUCHER>
<INVOICE>
<VENDOR>
<ID>
<VOUCHER>
<INVOICE>
<ID>
<VOUCHER>
<PAYMENT>
<AMOUNT qualifier="PAYMENT" type="T">
<VOUCHER>
<DATETIME qualifier="BASE_DATE">
<YEAR>
<MONTH>
<DAY>
Alright, so, here's where I'm lost . . .
First: By reading the manual ( I see that i need to create a view of the table ('table1') where I can reference the fields ('field1', 'field2', etc) with the column alias 'AS' so that the fields match with the expected xml elements. Now, with the first two xml elements, they both end up being '<ID>' . . . and I'm pretty sure that I can't alias two different fields ('field1' & 'field2') as the same ('AS ID' for both of them). So, how do I rectify this?
Second: How do I relate the third xml element example (with attributes of 'qualifier' and 'type') to a field (‘field3’)? For example, there are multiple '<AMOUNT' elements with different attributes - so, I need to differentiate between those.
Third: How do I combine the multiple elements in the fourth xml element example (year, month, day) into a single field (‘field4’)?
Whew! OK, I know there’s quite a bit here . . . but, I’d appreciate any and all input/assistance. You all rock!
DD