Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
sudms
Contributor
Contributor

Select Query Nested data from REST data source

Hello,

I am reading data from REST endpoint which is in XML format. Below is the format of data.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:GetRawDataOutputElement xmlns:ns2="http://xml.ws.abc.com/">
<conversations>
	<conversationId>6d0ef73c</conversationId>
	<conversationTimestamp>2020-01-25T03:43:43.398Z</conversationTimestamp>
	<clickedLinkURL>
            <URL>https://service.abc.com/c/portal/iframe/977729/</URL>
            <URL>https://service.abc.com/c/portal/iframe/860182/</URL>
    </clickedLinkURL>
</conversations>
</ns2:GetRawDataOutputElement>
</soap:Body>
</soap:Envelope>

Here if you see the clickedLinkURL has 2 URL tags in it but using the below SQL query I get only one. Any help here to get both the URL?

Below is the SQL script.

SQL SELECT 
	"attr:soap" AS "soap",
	"__KEY_Envelope",
	(SELECT 
		"__KEY_Body",
		"__FK_Body",
		(SELECT 
			"attr:ns2" AS "ns2",
			"__KEY_GetRawDataOutputElement",
			"__FK_GetRawDataOutputElement",
			(SELECT 
				"conversationId",
				"conversationTimestamp",
				"__KEY_conversations",
				"__FK_conversations",
				(SELECT 
                    "URL"
                    ,"__FK_clickedLinkURL" 
                FROM "clickedLinkURL" FK "__FK_clickedLinkURL")
			FROM "conversations" PK "__KEY_conversations" FK "__FK_conversations")
		FROM "GetRawDataOutputElement" PK "__KEY_GetRawDataOutputElement" FK "__FK_GetRawDataOutputElement")
	FROM "Body" PK "__KEY_Body" FK "__FK_Body")
FROM XML "Envelope" PK "__KEY_Envelope" with connection( BODY "$(vRequestBody)");
Labels (1)
0 Replies