Dynamic Typed List Multi-Row Field Rollup (to delimited)

Posts   
 
    
cycling321
User
Posts: 11
Joined: 29-Jul-2005
# Posted on: 08-Aug-2005 21:35:45   

Is it possible to define a dynamic typed list field that rolls up data into a comma-delimited field?

For example, say you have this hypothetical dataset:

VEG Vegetables

CEL Celery PTO Potato

FRU Fruits

APL Apple BAN Banana ORG Orange PIN Pineapple

Suppose I wish to return a dynamic typed list containing a list of food types (vegetables, fruits) with a column containing the list of ID's for related sub-entities in a comma delimited list. An output would be like this:

VEG Vegetables CEL,PTO FRU Fruits APL,BAN,ORG,PIN

Is there any way to do this? Otherwise, how would one go about creating a typed list and returning multiple related entities? Thanks for your thoughts. Sorry for the lame hypothetical dataset...I'm really hungry. smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Aug-2005 10:00:36   

No, I don't think that's possible. You could of course fetch the data in one go in a dyn. list, and traverse it at runtime, concatenating the values with comma's.

What you need is an aggregate function that is ran during a group by. I'm not sure if that's already possible, without sqlserver 2005 tricks.

Frans Bouma | Lead developer LLBLGen Pro