UFN_ACCOUNTSTRUCTURE_GETMETADATA_TOITEMLISTXML
Used to convert the results of UFN_ACCOUNTSTRUCTURE_GETMETADATA to xml.
Return
Return Type |
---|
xml |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@SEGMENTSONLY | bit | IN |
Definition
Copy
CREATE function [dbo].[UFN_ACCOUNTSTRUCTURE_GETMETADATA_TOITEMLISTXML]
(
@SEGMENTSONLY bit
)
returns xml
as
begin
return (
select
[CLOSINGELEMENT],
[ELEMENTTYPECODE],
[ID],
[LENGTH],
[DESCRIPTION],
[SEGMENTCOLUMN],
[SEGMENTSEQUENCE],
[ELEMENTDEFINITIONCODE],
[SEQUENCE],
[SEPARATORCODE],
[SEPARATOR]
from dbo.[UFN_ACCOUNTSTRUCTURE_GETMETADATA](@SEGMENTSONLY,null)
order by case @SEGMENTSONLY
when 1 then SEGMENTSEQUENCE
else SEQUENCE
end
for xml raw('ITEM'),type,elements,root('ACCOUNTSTRUCTURE'),BINARY BASE64
)
end