Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
-
jg123
- Posts: 1
- Joined: Wed Sep 23, 2015 2:13 pm
I have a project set to read the xml and insert the data values into database table.
xml file is somewhat like this :
<?xml version="1.0" encoding="UTF-8"?>
<CHARGES>
<partner>abc</partner>
<CHARGE>
<chargetype>charge1</chargetype>
<chargevalue>something</chargevalue>
<CHARGE_DETAIL>
<CHARGE_TYPE>FUEL charge1</CHARGE_TYPE>
<CHARGE_AMOUNT>2.12</CHARGE_AMOUNT>
</CHARGE_DETAIL>
<CHARGE_DETAIL>
<CHARGE_TYPE>FUEL charge1</CHARGE_TYPE>
<CHARGE_AMOUNT>3</CHARGE_AMOUNT>
</CHARGE_DETAIL>
</CHARGE>
<CHARGE>
<chargetype>charge2</chargetype>
<chargevalue>somethingelse</chargevalue>
<CHARGE_DETAIL>
<CHARGE_TYPE>weighing station</CHARGE_TYPE>
<CHARGE_AMOUNT>10</CHARGE_AMOUNT>
</CHARGE_DETAIL>
<CHARGE_DETAIL>
<CHARGE_TYPE>lunchbreak</CHARGE_TYPE>
<CHARGE_AMOUNT>6</CHARGE_AMOUNT>
</CHARGE_DETAIL>
</CHARGE>
</CHARGES>
i have to read the values of header and details and insert it into the respective tables.
I generate a primary key for header and detail and the header_id is the foreign key in the details table.
if there is only one charge, it works like a charm , but if there are multiple charges reported , then I am loosing the header_id craeted if the first rowset.
not sure how to proceed.
but if there are multiple charges, then
so in the above scenario,
i should expect to see data like this :
header_charge_table
hdrid partner , col1, col2
10 abc charge1 somethign
11 abc charge2 somethignelse
details_charge_table should have :
id hdrid charge_type charge_amount
1 10 xyz 2
2 10 hij 3
3 11 rst 10
4 11 klm 6
whereas what is happening is :
header table reflects the correct records, but details table gets the foreign key as 11 for all of the rows.
any help will be appreciated.
-
Support_Rick
Support Specialist
- Posts: 592
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
JG123,
To further help you ... we need to see the Project XML, the Job Log run in Debug Mode and if possible, a working XML Example that we can test with.
We also need to know what company you're with so that we can tag this as a support call for them.
Thanks!
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696