Try sql: "PRAGMA table_info("table_name");" or sql:"select * from
sqlite_master"



Brona

> -----Original Message-----
> From: Michael Hunley [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 09, 2003 8:10 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] select with no results
>
>
> I was attempting to use a feature of select to retrieve some schema
> information.  I was using the fact that the first row returned
> from select
> is the list of column names, so "select * from <table>" gives me the list
> of columns for some diagnostics.  However, SQLite does not return
> this row
> if there are no results, from setting limit 0, from a where clause that
> finds no results or if there is no data yet in the table.  Is
> that correct
> behavior?  In Mysql, for instance, I can get an empty result set back and
> still call the API to get meta info about the results (field names, etc).
>
> Is my only option to parse the SQL statement that created the
> table in the
> first place (seems like redundant work since SQLite already did
> this for me)?
>
> Also, is there any plans to allow a select or add an API call to extract
> the type label for a column?
> What about to retrieve the array of lengths of each result row?  It would
> seem that SQLite has that info and it could be made available pretty
> easily, renmoving redundant work of calling strlen on each field if you
> need to know that info.  Just a thought/humble request.
>
> thanks.
>
> Michael Hunley
> Senior Engineer
> PocketPurchase, Inc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to