> I've update to 7.4.03.17 now without any problems. 
> Unfortunately now I get a seg fault (Python 2.2/ Linux) with 
> the following code (sorry for being a newbie on this....):

Not really a reason why the driver should crash (I suppose
crash means core dump and not SQLException), but your
code would look better as follows:

C = sapdb.connect(....)
        
insert = C.prepare ("INSERT INTO maildata (data) VALUES (?)")
result = insert.execute ([msg['Header']])  # must be a list
header_id = result.getLastSerial()      
 
debug_message("Mail inserted 1")
        
# insert the text body  
result      = insert.execute ([msg['Body'])
textbody_id = result.getLastSerial()

Apart from being more efficient when you have lots of inserts,
this style has also many other advantages
- you don't have to worry about single quotes in the data you're inserting
- it is the only way yo update LONG columns
- it is the only way to insert LONG columns beyond a certain size

If you're doing just one insert at a time, you could also use the following
result = C.sqlX ("INSERT INTO maildata (data) VALUES (?)", [msg['Body'])

> P.S.: Could you give some additional examples on the python 
> interface in your docs and mention the getLastSerial()?

I'd love to, but my folder 'Signed, promised and not delivered' is
already way too large.

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