[DB-SIG] Sample Code of Python/MySQL

Andy Dustman adustman@comstar.net
Wed, 21 Jul 1999 13:47:50 -0400 (EDT)


On Wed, 21 Jul 1999, M.-A. Lemburg wrote:

> Brad Stec wrote:
> > 
> > I'm putting in some examples of the various SQL commands and ways to get the
> > data.  Its really for complete novices... like me. :)  I decided that as I
> > learn it I might as well document it.
> > 
> > I'll send you what I get when I get it done.
> 
> Could you put the examples on web-pages ? That way Andrew could link
> to it from the database topics guide on www.python.org.

That really would be better. All the DB API database modules work
basically the same. The two main exceptions to this are: A) the connect
method (very database dependent) and B) formatting of parameters into
query strings (same). For example, mxODBC (or perhaps, more accurately,
ODBC) uses a question mark to indicate where a parameter should be
substituted in, and MySQLdb uses %s, and some others use :1, :2, etc. 

-- 
andy dustman  | programmer/analyst |  comstar communications corporation
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d