Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6828001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:19:55+00:00 2026-05-26T22:19:55+00:00

Right now I’m getting schema in XML format like this <Header> <data1> </data1> <Line>

  • 0

Right now I’m getting schema in XML format like this

<Header>
  <data1> </data1>
  <Line>
      <data> </data>
      <VLine>
            <data> </data>
            <LUI></LUI>
      </Vline>
  </Line>
</Header>

By using following stored procedure

Select * from
EDI834_5010_Header Header
join EDI834_5010_2000 Line on Header.BGN02__TransactionSetIdentifierCode = Line.Id_BGN02__TransactionSetIdentifierCode
left join EDI834_5010_2300_DTPLoop VLine on Line.REF02_MemberSupplementalIdentifier = VLine.Id_REF02__SubscriberIdentifier and Header.BGN02__TransactionSetIdentifierCode = VLine.Id_BGN02__TransactionSetIdentifierCode
left join EDI834_5010_2300_LUILoop LUI on LUI.Id_BGN02__TransactionSetIdentifierCode=Header.BGN02__TransactionSetIdentifierCode and LUI.Id_REF02__SubscriberIdentifier=Line.REF02_MemberSupplementalIdentifier
for xml auto,ELEMENTS

END

But I need to get the schema like this in xml

<Header>
    <data1> </data1>
    <Line>
       <data> </data>
       <VLine>
          <data> </data>
       </Vline>
       <LUI>
             <data> </data>
       </LUI> 
    </Line>
</Header>

How should I change my above stored procedure to get the schema like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:19:55+00:00Added an answer on May 26, 2026 at 10:19 pm

    Try this, not tested by me so there may be any number of typos in there.

    select *,
           (select *
            from EDI834_5010_2300_DTPLoop VLine
            where Line.REF02_MemberSupplementalIdentifier = VLine.Id_REF02__SubscriberIdentifier and Header.BGN02__TransactionSetIdentifierCode = VLine.Id_BGN02__TransactionSetIdentifierCode
            for xml auto, elements, type),
           (select *
            from EDI834_5010_2300_LUILoop LUI
            where LUI.Id_BGN02__TransactionSetIdentifierCode=Header.BGN02__TransactionSetIdentifierCode and LUI.Id_REF02__SubscriberIdentifier=Line.REF02_MemberSupplementalIdentifier 
            for xml auto, elements, type)
    from EDI834_5010_Header Header
      join EDI834_5010_2000 Line 
        on Header.BGN02__TransactionSetIdentifierCode = Line.Id_BGN02__TransactionSetIdentifierCode
    for xml auto, elements
    

    Used this to test if the sub-queries work and it looks like they do.

    declare @t1 table (id int)
    declare @t2 table (id int)
    declare @t3 table (id int)
    
    insert into @t1 values (1),(2)
    insert into @t2 values (1),(2)
    insert into @t3 values (1),(2)
    
    select *,
           (select *
            from @t2 as t2
            where t1.id = t2.id
            for xml auto, elements, type),
           (select *
            from @t3 as t3
            where t1.id = t3.id
            for xml auto, elements, type)
    from @t1 as t1
    for xml auto, elements
    

    Result:

    <t1>
      <id>1</id>
      <t2>
        <id>1</id>
      </t2>
      <t3>
        <id>1</id>
      </t3>
    </t1>
    <t1>
      <id>2</id>
      <t2>
        <id>2</id>
      </t2>
      <t3>
        <id>2</id>
      </t3>
    </t1>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm doing something like this: RewriteRule ^/?logout(/)?$ logout.php RewriteRule ^/?config(/)?$ config.php I
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName
Right now i am successfulling getting the value of an element by doing this:
Right now i am doing something like this to remove the words from myList,
right now I have this pulling data for the current week, but the week
Right now when i do something like this: use strict; use warnings; package My::Test;
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?),
Right now my ant task looks like. <javadoc sourcepath=${source} destdir=${doc}> <link href=http://java.sun.com/j2se/1.5.0/docs/api/ /> </javadoc>
Right now, I have a domain entity named StyleBundle. This StyleBundle takes a list
right now i have this <script type='text/javascript'> $(#beau).click(function(){ $(#beau).animate({margin-Top: 738px}, fast); }); </script> and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.