On Sat, 2007-05-12 at 08:02 -0700, Mike Johnston wrote:
> When doing a "select * from foo" and using sqlite3_step() with 
> the associated sqlite3_column_xx funcs, is the order of the 
> columns in the resultset deterministic?
> 
> What is the rule that defines what the order?  
> it seems to be the order of the create table statement...

Right on both counts. It is deterministic, and they are in 
the same order as in the CREATE TABLE statement. (Zero is the
leftmost column in the CREATE TABLE).

A lot of people think it's bad practice to write "SELECT *"
in application programs. If a column is added to the table
later on, the extra column might surprise the application
code. On the other hand, it could be just what you want.

Dan.

>   
> but I can't seem to find where it is written a "select *"must follow that 
> order.
> 
> TIA
> 
>  
> ---------------------------------
> No need to miss a message. Get email on-the-go 
> with Yahoo! Mail for Mobile. Get started.


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to