sqlite newbie questions

Luis M. González luismgz at gmail.com
Thu Jun 21 17:54:07 EDT 2007


On Jun 21, 4:24 pm, "kf9... at gmail.com" <kf9... at gmail.com> wrote:
> Hello,
>
> I have a sqlite database table which has a table named "Transmittal".
> Before inserting a new record into the database, i'd like to perform
> some checking. How do i select all records with certain value (say
> "Smith") for a column (say "Last_Name")? Knowing almost nothing about
> SQL, i just selected everything and process the returned list.
>
> cur.execute('select * from Transmittal')
> records = cur.fetchall()
>
> Also, how do i delete records with certain value for centain column. I
> was thining of something like
> cur.execute('delete * from Transmittal where Last_Name=?', "Smith")
> but the syntax it's not correct.
>
> Thanks for your help.
>
> kelie

You need to learn sql if you want to deal with databases.
Don't worry, it's very easy, and here is a very good resource to get
you up and running in a few minutes:
http://www.sqlcourse.com

Good luck!
Luis




More information about the Python-list mailing list