[Zope] Inserting values into db - problems

Wayne Pascoe wayne.pascoe@ehsrealtime.com
Wed, 13 Mar 2002 09:55:49 +0000


Hi all,

Part of a site I'm working on needs to be able to insert job numbers into a
database. I'm using PostgreSQL as the backend and psycopg as the connecter.
I am able to select values from the database without problems. However, I
can insert anything.

I have a dtml document that prompts for values called addJobNumber. This has
an action of another dtml document named commitJob. commitJob has a
dtml-call to insert_job which is a Z SQL method.

The Z SQL method is as follows:

insert into y8 values(
now(), 
now(),
<dtml-sqlvar  client type="string">
<dtml-sqlvar  description type="string">,
<dtml-sqlvar product type="string">,
nextval('y8_number'),
<dtml-sqlvar  description type="string">,
<dtml-sqlvar  client_job_number type="string">,
<dtml-sqlvar  client_po_number type="string">,
<dtml-sqlvar  client_contact type="string">,
<dtml-sqlvar  tech_contact type="string">,
<dtml-sqlvar  job_close_date type="string">
)

When I try this, I get an error saying :

Missing input variable, client


Traceback (innermost last):
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 150, in
publish_module
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 114, in
publish
  File /usr/local/zope/lib/python/Zope/__init__.py, line 158, in
zpublisher_exception_hook
    (Object: localhost)
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 98, in publish
  File /usr/local/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply
    (Object: commitJob)
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 39, in
call_object
    (Object: commitJob)
  File /usr/local/zope/lib/python/OFS/DTMLDocument.py, line 127, in __call__
    (Object: commitJob)
  File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 473,
in __call__
    (Object: commitJob)
  File /usr/local/zope/lib/python/Shared/DC/ZRDB/DA.py, line 414, in
__call__
    (Object: insert_job)
  File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 473,
in __call__
    (Object: <string>)
  File /usr/local/zope/lib/python/Shared/DC/ZRDB/sqlvar.py, line 99, in
render
    (Object: client)
Missing Input: (see above)

If I remove the dtml-call in the commitJob document and just print each
value using 
<dtml-var client><br><br>
All values print as expected (as entered on the previous form)

Is there anything obvious that I'm missing here that could be causing this
problem ? 

TIA,

-- 
Wayne Pascoe <wayne.pascoe@ehsrealtime.com>

The price of freedom is eternal vigilance
   - Thomas Jefferson