logo       

Re: .dump command of sqlite: msg#00022

python.db.pysqlite.user

Subject: Re: .dump command of sqlite

The way that I do it is rather primative, but works like a charm, all I
do is try and select against the table, and catch the
sqlite.DatabaseError exception, then create the table in the except
clause; here is some sample code:

def createMusicTypeTable(self):
try:
cur.execute('SELECT * from MusicType')
except sqlite.DatabaseError:
columnNames = ('MusicType', \
'ID', \
'Description', \
'Active')
cur.execute('CREATE TABLE %s \
(%s INTEGER PRIMARY KEY, \
%s VARCHAR(50), \
%s INTEGER)', columnNames)
self.logger.info('Created MusicType Table')

Thanks,

Greg Givler
Information Technology
Lockwood®
10 Valley Stream Parkway
Malvern, PA 19355
Phone: (484) 605-4826
Email: ggivler-zdgUFu1MqnQ@xxxxxxxxxxxxxxxx




David Pratt

<fairwinds@xxxxxxxxxx To: pysqlite mailing
list <pysqlite-IAPFreCvJWPBWskQ1e/+sw@xxxxxxxxxxxxxxxx>

a> cc:

Sent by: Subject: Re: [pysqlite]
.dump command of sqlite
pysqlite-bounces@list

s.initd.org





05/01/2006 12:28 AM









Hi. I am looking to test whether a table is in an sqlite database. What
is the name of the table. In postgres this would be a lookup in
pg_tables. Many thanks.

Regards,
David
_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/+sw@xxxxxxxxxxxxxxxx
http://lists.initd.org/mailman/listinfo/pysqlite

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please call the help desk at ext 4850
______________________________________________________________________




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise