cancel
Showing results for 
Search instead for 
Did you mean: 

Re:Combining Sql Query

Former Member
0 Kudos

hi friends

I am having 8 sql queries each query return some values i want combine the result of all the queries can you any one tell me how to do this is there anyother way other than union and normalaisation action to get the result after combining the result i want to perform some calculation.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

How do you want to combine or Join these queries? Do they have a common column?

Joe Montagna

Former Member
0 Kudos

Hi Joe

I want to join the output of all the queries Each qury having the different column name

Former Member
0 Kudos

Is there a common parameter that you sort on? How do you want to combine the output - do you want to take the output from each query and put the columns next to each other? Does the data in row 1 from the first query "match up" with the data from row 1 of the second query, etc..?

Joe

Former Member
0 Kudos

hi Joe,

There is no Comman Parameter.Each Query returning only one value anyway all the queries return single value (single row)only.

Former Member
0 Kudos

From what you are telling me it sounds like you should be able to do this on the SQL side possibly in a stored procedure.

Or if you want to use Business Logic - You will simply need to create an xMII (Illum) Document:

Add a Document action block and define your columns

Add a sequence with all your SQL query action blocks

Add a Row action block to map the output from the queries to the columns in the xMII document.

OR if you don't want to use Business Logic try an Aggregate query - that should also work.

Joe

Former Member
0 Kudos

Hi Joe

Thanks,I got the output

Answers (2)

Answers (2)

Former Member
0 Kudos

DevaKrishnan,

Without more specific information and shape of your data, consider the folllowing...

Add a new xMII XML Document action block. Create the column names in the document which correspond to your desired output. After each SQL query, use the repeater action to walk through each row. Use the xMII XML Row action block to add the appropriate data from the repeater into the xMII XML document. Repeat this process on each of the 8 queries.

Regards,

Michael Teti

Former Member
0 Kudos

hi michael,

Thanks for your reply is there any other way apart from this

jcgood25
Active Contributor
0 Kudos

Create a stored procedure or view on the database server and then just call the procedure from your FixedQuery. This can easily be done within a BLS transaction as well.

Regards,

Jeremy