Re: [Tutor] database programming

2005-02-21 Thread Alan Gauld
> Oh, and don't forget the c.commit() part! That had me running around > in circles all night last night. Yep, I got got with lack of commit syndrome when I started with SQL too :-) > PS Anyone know if there's a way to get a list of tables in a DB? I've > got the pragma to get a list of columns i

Re: [Tutor] database programming

2005-02-21 Thread Liam Clarke
/me smacks head. Thanks Kent. Exactly what I need. Regards, Liam Clarke On Mon, 21 Feb 2005 16:21:23 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > > PS Anyone know if there's a way to get a list of tables in a DB? I've > > got the pragma to get a list of columns in

Re: [Tutor] database programming

2005-02-21 Thread Kent Johnson
Liam Clarke wrote: PS Anyone know if there's a way to get a list of tables in a DB? I've got the pragma to get a list of columns in a table, but just in the off chance... AFAIK there is no standard way to do this - it is different for each database. For SQLite, see this FAQ: http://www.sqlite.org/

Re: [Tutor] database programming

2005-02-21 Thread Liam Clarke
>>>import sqlite >>>x = sqlite.connect('mysqlitedb') >>>cx = x.cursor() >>>cx.execute( 'create table foo (columnA varchar(15), columnB number(3))' ) >>>cx.execute ('insert into foo (columnA, columnB) values ("Parrot", 90)') >>>x.commit() >>>cx.execute('select * from foo') >>>cx.fetchall() [('Parr

Re: [Tutor] database programming

2005-02-21 Thread Danny Yoo
On Mon, 21 Feb 2005, Chris Mallari wrote: > hi there! can u pls send me sample code in accessing a simple database > using python. Hi Chris, You may want to look at the Database topic guide: http://www.python.org/topics/database/ It has links to examples, tutorials, and other documentati

Re: [Tutor] database programming

2005-02-21 Thread Michael Dunn
Hi Chris, If you just want to learn about databases, then sqlite is a good way to go. It's small, it's typeless (which means you don't have to define ahead of time what sort of thing is going to go in which bit of the database; python is typeless too), and it is not split into client and server (m

[Tutor] database programming

2005-02-21 Thread Chris Mallari
hi there! can u pls send me sample code in accessing a simple database using python. Chris Mallari thanks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor