Carl Karsten wrote: > Ed Leafe wrote: >> On Jan 6, 2007, at 2:07 PM, Carl Karsten wrote: >> >>>> INFORMATION_SCHEMA does exist in some database systems. >>> Please give an example. >> >> [EMAIL PROTECTED] ~/projects/ide]$ sqlite3 test.db >> SQLite version 3.3.5 >> Enter ".help" for instructions >> sqlite> select count(*) from INFORMATION_SCHEMA.COLUMNS; >> SQL error: no such table: INFORMATION_SCHEMA.COLUMNS > > bummer. I was hoping INFORMATION_SCHEMA.COLUMNS > would be a way around: > > """...since grabbing an empty cursor, > as is done in the default method, doesn't provide a > description. """ > > I do see > "SELECT name FROM sqlite_master WHERE type='table' AND name=%s" % > self.escQuote(tablename)) > > Does sqlite_master store column names too?
Nope, just tables and indexes. However, it does contain the entire original CREATE command that created the table, so you could parse out the field names from that if you wanted to. However, because sqlite really only knows about INT, TEXT, and BLOB, you may or may not get the correct column information. This is why I use DataStructure instead: it is the application that knows the structure of the data, so I trust the info I explicitly set in the application. -- pkm ~ http://paulmcnett.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
