On Mon, 2005-05-02 at 11:56 +0200, Karsten Hilbert wrote:
> > The key is getting the "cursor". Once you have a cursor you can do inserts,
> > updates and deletes, like
> Huh ? Pardon me ? Doing inserts, updates and deletes via a
> cursor ? The PostgreSQL documentation clearly says that the
> <query> part of a cursor definition must be a SELECT:
>
> http://www.postgresql.org/docs/7.4/static/sql-declare.html
>
> (I am well aware that SELECT queries may have side
> effects that change data in the backend such as in
> "select add_new_customer()" etc.)
>
BTW, look at this page (with the Oracle driver):
http://www.zope.org/Members/matt/dco2/dco2doc
cursor.execute("INSERT INTO TEST (name, id) VALUES (:name, :id)",
name="Matt Kromer", id="1")
I believe there are databases that allow you to send SQL statements (any
kind, not only SELECTs) only in a cursor (either implicit or explicit),
hence the name for the cursor object.
.TM.
--
____/ ____/ /
/ / / Marco Colombo
___/ ___ / / Technical Manager
/ / / ESI s.r.l.
_____/ _____/ _/ Colombo@ESI.it