Re: [sqlite] bug "PRAGMA table_info"
Thank you! On 06/19/2012 08:25 PM, Jay A. Kreibich wrote: > On Tue, Jun 19, 2012 at 08:16:37PM +0200, Patrik Nilsson scratched on the > wall: >> Hi All, >> >> I use "PRAGMA table_info" to check my tables at start up and if the >> table columns are the need of updating (adding or removal) I do that. >> >> After a redesign of how the databases are managed this doesn't work >> anymore. Instead of using several database connections, I use one. >> >> The cleaned up the code looks better and is less error prone to select >> the wrong database connection, but it comes with a prize: >> >> "PRAGMA table_info" does not take databases as table names. "test" works >> as an argument, but "main.test" doesn't. > > > No, but following the standard of every other PRAGMA, this does work: > > PRAGMA main.table_info( test ); > > > See the syntax diagrams here: http://sqlite.org/pragma.html > >-j > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] bug "PRAGMA table_info"
On Tue, Jun 19, 2012 at 08:16:37PM +0200, Patrik Nilsson scratched on the wall: > Hi All, > > I use "PRAGMA table_info" to check my tables at start up and if the > table columns are the need of updating (adding or removal) I do that. > > After a redesign of how the databases are managed this doesn't work > anymore. Instead of using several database connections, I use one. > > The cleaned up the code looks better and is less error prone to select > the wrong database connection, but it comes with a prize: > > "PRAGMA table_info" does not take databases as table names. "test" works > as an argument, but "main.test" doesn't. No, but following the standard of every other PRAGMA, this does work: PRAGMA main.table_info( test ); See the syntax diagrams here: http://sqlite.org/pragma.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] bug "PRAGMA table_info"
Hi All, I use "PRAGMA table_info" to check my tables at start up and if the table columns are the need of updating (adding or removal) I do that. After a redesign of how the databases are managed this doesn't work anymore. Instead of using several database connections, I use one. The cleaned up the code looks better and is less error prone to select the wrong database connection, but it comes with a prize: "PRAGMA table_info" does not take databases as table names. "test" works as an argument, but "main.test" doesn't. Best Regards, Patrik patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "PRAGMA table_info(page)" 0|id|integer|0||1 1|type|integer|0||0 2|sortorder|integer|0||0 3|width|integer|0||0 4|height|integer|0||0 5|sizedata|integer|0||0 6|deleted|integer|1|0|0 7|viewwidth|integer|1|0|0 8|fontname|text|0||0 9|fontsize|integer|1|0|0 10|comment|text|0||0 11|data|blob|0||0 patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "PRAGMA table_info(main.page)" Error: near ".": syntax error patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "create table testa(a integer)" patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "PRAGMA table_info(testa)" 0|a|integer|0||0 patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "PRAGMA table_info(main.testa)" Error: near ".": syntax error patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "create table main.testb(a integer)" patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "PRAGMA table_info(testb)" 0|a|integer|0||0 patrik@debian:~$ ~/Projects/DMemory/trunk/shell/sqlite3 /home/files/test.dmemory "PRAGMA table_info(main.testb)" Error: near ".": syntax error patrik@debian:~$ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users