[Zope] INSERT Syntax with Zope & ZPyGreSQLDA

lstep@mail.dotcom.fr lstep@mail.dotcom.fr
13 Mar 1999 16:39:02 +0100


Hello,

I'm trying to use PostGreSQL with Zope, but I'm having
problems using the SQL INSERT method in Z methods which
require parameters.

For example, I make a Z SQL Method named 'foo'.
In it:
INSERT INTO messages
VALUES
  (<!--#sqlvar auteur type="string"-->, 
   'blahblahblah', 'now', 'f')

I write the name auteur in the 'arguments' form.

Next I create a DTML document with:
<form action="foo" method="GET">
Auteur: <input width="30" name="auteur" value=""><br>
<input type="submit" name="SUBMIT" value="Envoyer">
<form>

When submitting the form, it displays me a new page
(generated by Zope) asking me again the auteur parameter,
as if the auteur variable wasn't passed to the Z SQL method :-(

Someone posted a mail recently with an example use
of INSERT, where he put '(auteur)' after the 'INSERT INTO messages'
text: INSERT INTO messages (auteur) ...

When I try this, I get:

Error, pg.error: server fatal error. Please report to your db administrator. 

SQL used:

INSERT INTO messages (auteur)
VALUES
  ('testing again', 
   'blahblahblah', 'now', 'f')

Is there something specific to PostGreSQL ?
(Using Zope 1.10.2, PostGreSQL 6.4.2, PyGreSQL-2.2, ZPyGreSQLDA 0.02)

I looked in the Z SQL Method User's guide, but nothing is written
about adding data to a DB :-(

-- 
Luc Stepniewski <lstep@mail.dotcom.fr>
http://www.planete.net/~rstep/pubkey.txt
KeyID: 1024D/76A31F52
GnuPG: 819D 1F8E 7BE2 B80C AA2C  0473 CCED 48B6 76A3 1F52