-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/02/12 16:26, Pete wrote:
> How do I get a list of any temporary tables in a database?

There is a separate database named 'temp' that contains temporary tables.
 (The main database is named 'main' and you can omit its name.)

sqlite> pragma database_list;
seq|name|file
0|main|
1|temp|

> Once I have a list, can I use some form of PRAGMA table_info to get a
> list of the columns in a temp table?

sqlite> create temporary table foo(x);
sqlite> pragma temp.table_info(foo);
cid|name|type|notnull|dflt_value|pk
0|x||0||0

Note that non-obviously you put the database name before the pragma name.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk8t2wwACgkQmOOfHg372QRifwCfTd6IRXXgQNvKzf20Qig+Rh2r
03QAnimZata5WgnUt3QmHFtnTqbKN7vU
=sofJ
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to