Hello.

I am trying to create a transaction that should insert a value
depending of the result of a select. This should be done at once by
the database in order to avoid some conflicts or duplicates.
An equivalent sql version of the transaction would be :

IF EXISTS (SELECT * FROM Table1 WHERE Column1='SomeValue')
    INSERT INTO Table1 VALUES (...)

Is there a way to do that using sqlalchemy ?
Having the "if" done by python is easy but not safe and i can't find
out how to do this using some begin/commit statements.

Thanks to help !

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to