Limiting Columns to Return

Posts   
 
    
DaveR
User
Posts: 43
Joined: 15-Jun-2004
# Posted on: 16-Aug-2005 00:34:18   

I have a view for which I only want to retrieve certain columns, for two reasons:

  1. Efficiency. Some of the columns are text fields that might be very long; I don't want to retreive them until I need them.

  2. Filtering duplicates. SQL Server does not allow DISTINCT queries if there are text columns.

The ideal scenario would be to indicate to the (SelfServicing) collection which fields to retrieve. If a field is accessed that was not retrieved, it would be retrieved on demand. I realize LLBLGen doesn't have such a feaure, but it might be useful.

I know that I can built a custom dynamic list and populate a DataTable using TypedListDAO() but this is not very convenient.

At this point I will probably just define another view that contains only those fields I am interested in, and use this separate view for the DISTINCT query. But I was hoping there was a better way.

Is there?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 16-Aug-2005 08:29:58   

Not at the moment. In the upcoming 1.0.2005.1 upgrade, you can map an entity to the view and exclude certain fields, for example your textfields. I'll see if there is time to also add this for views.

Frans Bouma | Lead developer LLBLGen Pro