Truncation of result XML using Select xmlelement
240130Dec 12 2002 — edited Jan 9 2003I am trying the new XMLELEMENT Function of Select, and the resulting XML is truncating. It appears that only very short XML strings return properly. All others truncate.
Example:
Table Token
Token_Id Number;
Token_load_id Varchar2(64);
Table Batch
Batch_Id Number;
select xmlelement("Batch", xmlelement("BatchId" , b.batch_Id),
xmlelement("Card", xmlelement("TokenId" , t.token_Id),
xmlelement("TokenLoadId", substr(t.token_load_Id,1,20)))) as "XMLResult"
from token t, token_batch b
where t.batch_id = b.batch_id
and token_id < 110;
Result:
XMLResult
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<Batch>
<BatchId>1</BatchId>
<Card>
<TokenId>100</TokenId>
<TokenLoa
<Batch>
<BatchId>1</BatchId>
<Card>
<TokenId>101</TokenId>
<TokenLoa
.
.
.
So why would the result truncate? I built the above query based on examples in the CD doc set.