XML output duplicate constraint

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Elisabete
Participant
Posts: 17
Joined: Mon Jan 03, 2011 7:55 am
Location: Odivelas

XML output duplicate constraint

Post by Elisabete »

Hello to all,
I'm trying to generate an XML output but I have some problems with that. When I execute the process I have this result:

<Invoice>
<InvoiceNo>000000041844 8/9903</InvoiceNo>
<InvoiceStatus>N</InvoiceStatus>
<CustomerID>Consumidor final</CustomerID>
</ShipFrom>
<Line>
<LineNumber>2</LineNumber>
<LineNumber>4</LineNumber>
<ProductCode>CATG</ProductCode>
<Quantity>1</Quantity>
<UnitOfMeasure>UNIT</UnitOfMeasure>
<UnitPrice>137</UnitPrice>
<TaxPointDate>2010-02-04</TaxPointDate>
<Description>CATERING O/G</Description>
<CreditAmount>136.5</CreditAmount>
</Line>
</Invoice>

I have two lineNumber in the same Line (element), but I only want one... this is happens because the others values are the same.

But when I made change like partitionating by ordered I carrect the previews issues but now I have this issue:

ERROR: Element '{urn:OECD:StandardAuditFile-Tax:PT_1.01_01}Invoice': Duplicate key-sequence ['000000041844 8/9903'] in unique identity-constraint '{urn:OECD:StandardAuditFile-Tax:PT_1.01_01}InvoiceNoConstraint'.

and this result:


<Invoice>
<InvoiceNo>000000041844 8/9903</InvoiceNo>
<InvoiceStatus>N</InvoiceStatus>
<CustomerID>Consumidor final</CustomerID>
</ShipFrom>
<Line>
<LineNumber>2</LineNumber>
<ProductCode>CATG</ProductCode>
<Quantity>1</Quantity>
<UnitOfMeasure>UNIT</UnitOfMeasure>
<UnitPrice>137</UnitPrice>
<TaxPointDate>2010-02-04</TaxPointDate>
<Description>CATERING O/G</Description>
<CreditAmount>136.5</CreditAmount>
</Line>
</Invoice>
<Invoice>
<InvoiceNo>000000041844 8/9903</InvoiceNo>
<InvoiceStatus>N</InvoiceStatus>
<Line>
<LineNumber>6</LineNumber>
<ProductCode>PARK</ProductCode>
<Quantity>1</Quantity>
<UnitOfMeasure>UNIT</UnitOfMeasure>
<UnitPrice>16</UnitPrice>
<TaxPointDate>2010-02-04</TaxPointDate>
<Description>PARKINGCHARGE</Description>
<CreditAmount>15.73</CreditAmount>
</Line>
</Invoice>

I have two invoices with the same number, but I only want one.

Anyone can Help on this?
Thank you,
Elisabete
bicap
Premium Member
Premium Member
Posts: 95
Joined: Mon May 03, 2010 10:22 pm
Location: India
Contact:

Re: XML output duplicate constraint

Post by bicap »

Mark a key column which is unique..

thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Elisabete, you posted this question in multiple forums, a practice frowned upon here. I've deleted the duplicate posts, we'll use this one going forward.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply