[Zope] Return from ZSQL Update?

Christopher J. Kucera ckucera@globalcrossing.com
Fri, 28 Jan 2000 10:06:19 -0600


Greetings!

I've got a SQL Method which does an update on a table.  Obviously, when the row
I'd like to update exists, the SQL method works fine, but when the row isn't
there to begin with, the SQL method just does nothing.

Is there a way to find out if the update actually changed a row or not?  (And if
not, do an alternate INSERT statement instead of the UPDATE.)  I would have
expected to get an error back from the SQL method, but I get nothing.  I'm using
an Oracle database connection.

(Larger Picture:
Obviously one solution would be to do a SELECT on the table to determine if the
row exists, and then do an UPDATE or INSERT depending on the results of the
select, but I'd rather not do two SQL statements for every update I'm trying to
do.)

Thanks for your help in advance!

-CJ