From: | Marco Colombo <marco(at)esi(dot)it> |
---|---|
To: | Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Python DB-API 2.0 oddity (was: I receieved an example of |
Date: | 2005-05-02 11:39:46 |
Message-ID: | 1115033986.17311.41.camel@Frodo.esi |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-odbc |
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(at)ESI(dot)it
From | Date | Subject | |
---|---|---|---|
Next Message | Sean Davis | 2005-05-02 11:57:22 | Re: scripts in Postgres |
Previous Message | Marco Colombo | 2005-05-02 11:31:25 | Re: Python DB-API 2.0 oddity (was: I receieved an example of |
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Korotun | 2005-05-03 09:54:30 | remote tcp connection problem PG 8.0.1 |
Previous Message | Marco Colombo | 2005-05-02 11:31:25 | Re: Python DB-API 2.0 oddity (was: I receieved an example of |