Re: Python DB-API 2.0 oddity (was: I receieved an example of

Поиск
Список
Период
Сортировка
От Marco Colombo
Тема Re: Python DB-API 2.0 oddity (was: I receieved an example of
Дата
Msg-id 1115033986.17311.41.camel@Frodo.esi
обсуждение исходный текст
Ответ на Python DB-API 2.0 oddity (was: I receieved an example of Rekall script)  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [Dbdpg-general] Re: 'prepare' is not quite schema-safe
Следующее
От: "Julian Mehnle"
Дата:
Сообщение: Re: 'prepare' is not quite schema-safe