On Thursday 07 October 2010 3:45:15 pm David Goldsmith wrote:
> I'm having a helluva time:
>
> 0) Getting a simple INSERT INTO statement to work;

I have not worked with particular module before but it follows the Python 
Db-api 
so something like below should work where fld_1 is string 
field(char,varchar,text,etc) and fld_2 is an integer field.

cur=conn.cursor()
cur.execute("insert into table_name(fld_1,fld_2) values(?,?)",('test',1))

For general view of dbapi:
http://www.python.org/dev/peps/pep-0249/

>
> 1) Finding a good, reasonably rich example set or "cookbook," esp. one
> geared toward a DB newbie such as myself;

Python cookbook?:
http://code.activestate.com/recipes/langs/python/tags/database/

>
> 2) Getting good help from the db-sig mailing list (case in point: I
> want to generate a list of tables available in a DB I've connected
> to--not only does this seemingly natural and basic operation not have
> a dedicated method to accomplish it, after two days, no one on db-sig
> has yet been able to explain to me how one might use existing methods
> to accomplish it--it's as if I'm the first person ever wanting to do
> this, and yet what could be more natural than wanting to write:
>
> if table in connection.tables():
>     act on table
> else:
>     do something else, e.g., complain
>
> Basic, ubiquitous dummy proofing.)
>
> If you think you can help me (and are willing, of course) please reply
> off list to david<dot>goldsmith<at>ecy<dot>wa<dot>gov.
>
> Thanks!!!
>
> DG



-- 
Adrian Klaver
[email protected]

Reply via email to