Is it possible to replace the value of a sessionVariable in mule for each iteration - foreach

I am trying to retrieve some values from the database. Out of which one field is encoded by base64. I need to produce the result by decoding that field. When the Database returns multiple rows as the result I am not able to fetch the decoded value for all the rows. I am using a foreach scope and iterating within the payload and saving the result in a SessionVariable. I am able to save the first row's decoded value. Other all row's values are printed as same as in the Database. Could someone help to resolve this.

i would suggest not to use sessionVars for each iterator...create a POJO equivalent to the Database and then create a ArrayList of that POJO. This will help in the performance as well as in logic.

The problem is the way you are using mule
mule <base64-decoder-transformer/>
ideally in you case it should be inside the for-each loop.

Related

How to update individual array element in firebase with iOS Swift?

Here i'm using firestore query to update, insert data. How to upadate dictionary of array value to firebase database.
here is my firestore data structure:
Right now able to get data of slot1 -> 0th position value in a model class.
how can i update value of slot1 0th position of isbooked boolean value alone, without affecting remaining values and other slot.
You can't without reading the entire document, modifying the array data in memory, then updating the entire array field back out do the document. The smallest unit of change in a Firestore array field is an entire field. You can't make smaller changes to individual elements of a field, except those defined by arrayUnion and arrayRemove (which are not compatible with what you're trying to do here).
You can do that by getting the exact id of your structure ..
Database.database().reference().child("SlotName").child(yourAry.key).child(yourAry.key).child("isbooked").setValue(true/false)
Manage your database structure accordingly, its just an example and as user Doug suggested have a look on docs too ..

Generate a flutter list from a Cloud Firestore query

I am trying to generate a list containing the 'name' parameters as Strings from this Firestore.instance.collection('videos').limit(10).snapshots(); query, but I am having trouble extracting the parameter values from the documents and returning them as a list. Would I have to use .forEach() or do I have to .map() the entries to a list? Any help would be highly appreciated!
Edit: Additionally I would like to query the documents in a certain range, but .startAt() does not seem to accept integers. Is there any way to query say the first 10 documents by using Firestore.instance.collection('videos').startAt(0).limit(10).snapshots();?
There is an example of doing this using a StreamBuilder at https://pub.dartlang.org/packages/cloud_firestore#-example-tab-

Pass an entire row to SQLite custom function

I am trying to create a SQLite custom function that will accept the entire row as its argument. An example query would be:
SELECT * FROM some_table ORDER BY custom_rank_function(<entire row>)
However, I'm unsure for the syntax to pass in the entire row. I tried using * but this passes each column value as a separate argument, which results in many arguments as my table has 15 fields. Is there any way to pass some kind of "row pointer" and then pull field values from this row pointer?
Thanks.
There is no syntax for this, because the SQLite API does not have any mechanism for this.

Combine multiple columns containing similar values into one column for use in graph inside Crystal Reports

I have 3 fields, Action1, Action2 and Action3 contained in one report. Each Action field is selected from the same list of values. I would like to graph a count of these values by the value of the field and not field itself. I need one graph and not one graph per Action field. I have tried to combine the field values into an array in the details section, but the report shows the concatenated string values "Action1, Action2, Action3', as a single value in the graph. I tried to graph using "on change of", but it will only allow 2 fields and not 3. Is there a way to count these values regardless of the Action field where they are found?
I have been working with Crystal for years, but can't figure this out for whatever reason.
I was never able to find a solution to this issue inside of Crystal Reports itself. What I ended up doing was creating a stored procedure in SQL to use as the data source. In the stored procedure I basically performed a cross join such that there was only 1 Action returned per record. In CR I then was able to summarize the Action field values.

Reporting Services - Determine whether or not Stored Procedure returns garbage fields

I have to develop a report against Sybase and I am calling a stored procedure for the dataset using an exec statement in a text query.
This stored procedure, instead of returning no records when there are none available, returns a table with a different column structure than that which is returned when records are available.
This causes all of my fields to display #ERROR. Is there a way to determine that the data set is going to return this garbage row so that I can hide the rows that are effected and handle the error?
Thanks so much for your help.
Frank
The solution for this is to check the IsMissing property on the dataset field:
Set the row's "Hidden" property to -
=IIF(Fields!FieldThatShouldBeThere.IsMissing,true,false)
Frank

Resources