Version 1 of tcl sqlite examples

Updated 2009-11-20 17:03:25 by jnc

Some examples of tcl and sqlite usage:

NOTE: the name of the database is opendb

 * Retrieve the names of the tables stored in a sqlite database:

set tableNames opendb eval {SELECT tbl_name FROM sqlite_master}

* Retrieve the names of the columns (variable columnName):

opendb eval "SELECT * FROM nuno LIMIT 1" x {set columnName $x(*)}

jnc You can also use PRAGMA table_info(table_name) to retrieve column information.

* Retrieve the row data from a table