On Tue, Mar 3, 2015 at 3:33 AM, Paolo Bolzoni
<paolo.bolzoni.brown at gmail.com> wrote:
>> I can't confirm that 100% off the top of my head but I'm uncoordinated
>> enough to repeatedly confuse the bind and column value API calls and use
>> 0-based indices for both and haven't noticed any really untoward behaviour
>> (beyond my code not working and requiring fixing).
>
> I know the feeling, I made it wrong so many times that I almost wanted
> to "fix" the index in my thin C++ wrapper...

Instead, you could consider having your wrapper throw an assertion if
someone doesn't bind all parameters.  Asserting if someone doesn't
consume all result columns is a little more dubious, because you'd
probably need an API call to explicitly ignore a column, but I'd not
consider such an assertion insane, either.  For either case using
indices leads to kind of brittle code in any case, regardless of
whether it's 0-based or 1-based.

-scott

Reply via email to