question

Ranju78 avatar image
Ranju78 asked

Query to xml from sql table

I have to concert a sql table into certain xml format. this the format i want in this way

<update table ="Courses" StartDate="20220921" EndDate="20220922">

<versions Subject="Gepgraphy" Count="13">

<version SubjectID="AR-0704-1258" VerNum="5" CreateDate="20121017" ModDate="20220921" DeleteDate="00000000" StartDate="201103" EndDate="202209" RCFlag="0">

<titles>

<title Subject="prime">Physical Therapy Specialty</title>

</titles>

<lengths>

<length MinWeeks="10" MinHours="400" />

</lengths>

<courses>

<course CourseID="303-N9" PhaseNumber="2" Service="Army" />

<course CourseID="303-68" Service="navy" />CourseID

</courses>

<locations>

<location LocationID="918" School="Coast Guard Academy" InstallationPlace="New London, CT" />

<location LocationID="915" School="TRACEN" InstallationPlace="Cape May, NJ" />

<location LocationID="849" School="Martin Community Hospital" InstallationPlace="Fort Benning, GA" />

<location LocationID="857" School="Reynolds ACH" InstallationPlace="Fort Sill, OK" />

<location School="Kimbrough ACH" InstallationPlace="Fort Meade, MD" />


I would like to have the title node this way

And like to have all records for Location /CourseID in one place.

sqlquery
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.