Status/Resolution/Reason: Closed/Won't Fix/
Reporter/Name(from Bugbase): Abram Adams / Abram Adams (Abram Adams)
Created: 10/14/2015
Components: Language
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Linux
Vote Count: 1
This feature makes a lot more sense if https://bugbase.adobe.com/index.cfm?event=bug&id=4073759 gets emplemented as well...
It would be very useful to be able to pass in a map function to the queryExecute function that would execute for each row in the results and allow you to transform the results. Like mentioned above, this would make more sense if the queryExecute method had a returntype that would allow you to return an array of structs.
Here's an example of how it would be used (assuming returnType ER is implemented):
users = queryExecute(
"SELECT userId, name
FROM users
WHERE userId = :userId ,
{userid=1},
{returnType="array"},
function( row ){
row[ "policies" ] = someService.getUserPolicies( row.userID );
row[ "friends" ] = queryExecute(
"SELECT userId, name
FROM users u
JOIN userFriends uf on uf.friendId = u.userId
WHERE uf.userId = :userId",
{userId: row.userId },
{returnType="array"});
return row;
}
);
This would output something like:
[
{id:1,name:"joe",policies:[{policyId:123},{policyId:145},{policyId:354}],friends: [{id:2,name:"jill"},{id:4,name:"bob"}]},
{id:2,name:"jill",policies:[{policyId:654},{policyId:655},{policyId:789}],friends: [{id:1,name:"joe"},{id:4,name:"bob"}]}
]
As you can see, this would allow you to build out rich relational data structures fairly simply.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4073770
External Customer Info:
External Company:
External Customer Name: Abram Adams
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: