Boost logo

Boost :

From: Steve Hutton (shutton_at_[hidden])
Date: 2006-10-07 14:27:03

On 2006-10-06, Jeremy Day <jeremy.day_at_[hidden]> wrote:
> On 10/6/06, james.jones_at_[hidden] <james.jones_at_[hidden]>
> wrote:
>> Surely you mean "... NOT using select *..."? I've always considered it a
>> best practice not to use select * in any production code. Is there another
>> perspective on this?

> It is my understanding that "select *" is generally less efficient than
> specifying the fields to select. Not to mention that if you are relying on
> select * to return fields in a specific order, and that order changes,
> you're in for some hard to find bugs.

Yes, if you are using select *, you should be using name based column
access instead of positional access. The combination of the two,
however, can help create code which is resistant to future changes.
It depends what your goals are, of course.

To bring things back on topic, I think it's a good thing for a db
library to support name based binding (and SOCI does). The use of
select * is one reason why it's valuable.


Boost list run by bdawes at, gregod at, cpdaniel at, john at