cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass Parameters in BLS

Former Member
0 Kudos

Hi,

I am using xMII version 11.5. I need to pass the output of a SQL Query as a input to another SQL Query in BLS. If I hard code I am able to get the answer but if I try using param in the Links its not working.

Sweety

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Sweety,

The output of your SQL Query is usually in XML format. But inputs to a SQL Query Param property are usually strings. What does your link editor show for the mapping? Are you grabbing the contents of a single node and passing that string to the Param property? Or are you grabbing chunks of xml (which will not work)?

Please post the expression editor contents here.

Regards,

Mike

Former Member
0 Kudos

Hi Mike,

I have given the output of the Sql Query to a Repeator then as an input to the next SQL query.. this is the expression in the Links. This is assigned to the Param.1

Repeator_GetEquipmentIDsForSelectedCell.Output{/Row/EquipmentId}

Sweety

0 Kudos

That looks like it should work. Can you put a tracer after the repeater and show the contents of the field of interest? What does it show?

Also can you show the SQL script for the action block after the repeater?

Thanks,

Mike

Edited by: Michael Appleby on Jan 25, 2011 7:07 AM

Former Member
0 Kudos

Hi Sweety,

Well.. You can configure XPATH expression (Configure Object) of Repeater to output of SQL Query 1.

Example: "<SQL Query1 Name>.Results{/Rowsets/Rowset/Row}"

Then, assign "<Repeater Name>.Output{/Row/<Column Name>}" to Param.1 variable of SQL Query 2.

Hope this helps.

Best Regards,

Kedar

Former Member
0 Kudos

Hi Mike,

This is the output of the Repeator First time : [INFO ]: 301

301 is given as an input to Second Query.

The output is found in the Tracer after the Second Query but when i add a Repeator2 after the Second Query, the rows are not found in the Configure Object. Only Columns are found.

This is the Output of second Query in the Tracer:

[INFO ]: <?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2011-01-27T12:28:02" EndDate="2011-01-27T12:28:02" StartDate="2011-01-27T11:28:02" Version="11.5.3"><Rowset><Columns><Column Description="ActualProduction" MaxRange="1" MinRange="0" Name="ActualProduction" SQLDataType="4" SourceColumn="ActualProduction"/></Columns>

<Row><ActualProduction>600</ActualProduction></Row>

<Row><ActualProduction>550</ActualProduction></Row>

<Row><ActualProduction>800</ActualProduction></Row>

<Row><ActualProduction>400</ActualProduction></Row>

</Rowset></Rowsets>

Sweety

0 Kudos

Can you show us the configured link for the input of the second repeater? Is it pulling from the first repeater or from the query results downstream from the first repeater?

I envision that you have something like this:

SQL Query action block:

Repeater with input configured as: SQL_Query_0.Results{/Rowsets/Rowset/Row}

Second SQL Query action block with Param.1 set as Repeater_0.Output{/Row/Plant}

And your second repeater's input would be SQL_Query_1.Results{/Rowsets/Rowset/Row}

So what do you expect your second repeaters output to be:

In tracer for 1st pass: (Repeater_1.Results{/Row/ActualProduction}]) 600

2nd pass: 550

3rd pass: 800

...

Is this the correct scenario?

Regards,

Mike

Former Member
0 Kudos

Hi Mike,

What you have said is correct...The second Repeator is taking input from the second query.. but the rows are not found in the links..

I m able to get the Rows from the second query only when i hard code in the configure links by setting the param value.

If i link the output of the first repeator to to the second query I m not able to get the output in the second query.

Regards,

Sweety

0 Kudos

What version of MII are you working with?

Can you assign the output to a Local Property and then assign it to the repeater?

Not sure what else will cause the problem.

Regards,

Mike

sidnooradarsh
Contributor
0 Kudos

Hello Sweety,

In addition to Mike's suggestions,

Not sure but quite possible that datatype mismatch might be an issue too and its worth a check

Please let us know which Database are you using and what are the datatypes of the fields that you are passing to from BLS?

Hope this helps!!

Regards,

Adarsh

Former Member
0 Kudos

Hi Mike,

I am usin 11.5 version.. I tried with transaction property.. didnt work

Hi Adarsh ,

I am using SQL DB.. the datatypes are mostly numeric and varchar...In BLS I used double for numeric..and for date i used string because i am converting the datetime into only date in sql

Regards,

Sweety

0 Kudos

Try converting the string dates back to DateTime and passing it to the corresponding Start and End date fields of the query.

Regards,

Mike

Former Member
0 Kudos

Hi Mike,

Thank you...I changed to Datetime in BLS and in the SQL Query i assigned to DateRange and its now working

Regards,

Sweety

Answers (0)