[sqlalchemy] Re: pymssql delete problem

2008-02-14 Thread fw

Thanks,

That seems to solve the problem.

Cheers,
  François

Rick Morrison wrote:
  Thanks for your continuing interest in  my silly problem

 It's not a silly problem, it's a important fundamental operation that ought
 to work correctly!

 Try the attached patch against pymssql 0.8.0.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: pymssql delete problem

2008-02-14 Thread Rick Morrison
In other news, pyodbc on Unix is alive again, thanks to the surprise
revelation that it actually can work, and shows a similar test profile to
running it on Windows. Stay tuned...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: pymssql delete problem

2008-02-13 Thread Rick Morrison
 Thanks for your continuing interest in  my silly problem

It's not a silly problem, it's a important fundamental operation that ought
to work correctly!

Try the attached patch against pymssql 0.8.0.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



pymssql.py.patch
Description: Binary data


[sqlalchemy] Re: pymssql delete problem

2008-02-12 Thread fw

Hi Rick,

Thanks for your continuing interest in  my silly problem

Rick Morrison wrote:
 How are you deleting the rows? Is this via Session.flush(), or an SQL
 expression statement?


Via a session commit/flush


 Please post some code as to how you're trying this...

The code goes something like this (not actual code!)

for x in listofproducts:
contlist=sess.query(Container).filter_by(Content=x).all()
for y in contlist:
quantity[x]-=y.Take(quantity[x])
if y.quantity==0:
sess.delete(y)
if quantity[x]==0:
break

sess.begin()
try:
sess.commit()
print OK
except:
sess.rollback()
print Ooops!


If only one container needs to be deleted, it works. More than one and
it fails. It all
works when using MySQL.

Cheers,
   François

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---