I kinda get your point, but still we are speaking of the C interface
all the time. Sure in other contexts, like the TCL/SQL, the indexes
start from 1. However the bind and the column function are both in the
C interface.

Oh, well... I just have to wrap my mind around it. Definitely not a
real problem, I was merely curious.

On Mon, Mar 2, 2015 at 1:23 AM, Jay Kreibich <jay at kreibi.ch> wrote:
>
> On Mar 1, 2015, at 5:33 PM, Richard Hipp <drh at sqlite.org> wrote:
>
>> On 3/1/15, Paolo Bolzoni <paolo.bolzoni.brown at gmail.com> wrote:
>>> Dear everyone,
>>>
>>> I find strange and confusing that bind indexes start from 1 (docs in
>>> [1]) and instead column indexes start from 0 (doc in [2]). Is there
>>> any technical reason or it is just an unlucky legacy?
>>
>> Seems like there was a reason for this, 11 years ago when it went in,
>> but I cannot now call that reason to mind right this moment.  So lets
>> just call it unlucky legacy.
>
> Every database I?ve every used starts SQL parameter indexes from 1.  I?m not 
> sure it is part of the SQL standard, but it is more or less the defacto 
> standard of SQL APIs, and might be considered part of the SQL language.
>
> I assume column indexes start at 0 because of C.  Column indexes are used 
> within the context of the C language API, so it makes some sense to use C 
> conventions.
>
>
> I know they?re very easy to confuse (I still do it myself), but I can kind of 
> see why we ended up there, even if it isn?t a very strong reason.
>
>  -j
>
>
> --
> Jay A. Kreibich < J A Y @ K R E I B I.C H >
>
> "Intelligence is like underwear: it is important that you have it, but 
> showing it to the wrong people has the tendency to make them feel 
> uncomfortable." -- Angela Johnson
>
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to