OK, here was my mistake:

this works:
cursor.execute('insert into TEST set TS = :ts, ID = :id, NUM = :num',
[sapdbapi.TimestampFromTicks(time.time()), "this is a 'quoted'
string"+str(x), 17.2])

this crashes Pythonwin.exe:
cursor.execute('insert into TEST set TS = :ts, ID = :id, NUM = :num', {'ts':
sapdbapi.TimestampFromTicks(time.time()), 'id': "this is a 'quoted' string2
"+ str(x), 'num':17.2})


I somehow thought that the named paramstyle meant I could package the params
as a dict and the dict key values would match to the named params in the SQL
(allowing, perhaps, random order params?)

Anyway, it causes a crash if you try this.

Moral:

Don't pass params this wrong way.


-----Original Message-----
From: Dittmar, Daniel [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 8:28 AM
To: 'Jeff Robbins'; [EMAIL PROTECTED]
Subject: RE: python paramstyle


> Is there a sample of the named style?  I've only managed to 
> make the qmark
> style work.


cursor = session.cursor ()
cursor.execute ('select * from messages where msgno > :msgno', [0])

works for me. What is the error in your case?

Daniel Dittmar

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to