DBI spec and parameter passing

Timothy Grant tjg at avalongroup.net
Mon Jan 17 18:07:54 EST 2000


Hi again,

I've been reading up on DBI and what it does, and I see that when I have
cursor for which I need to execute some SQL, I pass it some SQL and some
parameters, can someone please show me an example of how that is
supposed to look? Right now I build up a string using something like
this

	sql = "select * from table where id='%s'" % idvar
	cursor.execute(sql)

This seems to work quite well except in the in the instances where I
have *Empty* Data fields, then mxODBC reports errors back to me that
look like this:

('08S01', 1, "Error while executing the query;\012ERROR:  Bad date
external representation ''", 3205)

I'm not quite sure what to do to alleviate that problem.

Any help is greatfully accepted!
	
-- 
Stand Fast,
    tjg.

Chief Technology Officer              tjg at exceptionalminds.com
Red Hat Certified Engineer            www.exceptionalminds.com
Avalon Technology Group, Inc.                   (503) 246-3630
>>>>>>>>>>>>EXCEPTIONAL MINDS, INNOVATIVE PRODUCTS<<<<<<<<<<<<




More information about the Python-list mailing list