[Zope] error on dtml method, insert on postgres

CY cyhoong at pc.jaring.my
Fri Oct 17 21:23:29 EDT 2003


One possible error:
   <input type="hidden" name="vfechacompra" value=20031012>

   I think this is should  be written as value="20031012".


My favorite debug technique:

1.  change:  <form action="equipoTest" method="post">
2.   equipoTest method:
            <dtml-var REQUEST>

Explanation:
The <dtml-var REQUEST> will display all your form variables and its values
where you can  visually compare for typo errors.

This is very helpful.

Good luck.

> Hi folk
> 
> When try to insert on a postgres table show me the follow error
> 
> Zope Error
> 
> Zope has encountered an error while publishing this resource.
> 
> Error Type: _pg.error
> Error Value: ERROR: parser: parse error at or near "p" at character 137
> 
> <dtml-method>
>   <dtml-var std_header>
>    <h2>Datos del equipo</h2>
>     <p>
>     <form action="equipoAddDisplay" method="post">
>       <input type="hidden" name="vidtipo" value="2">
>       <input type="hidden" name="vidsubzona" value="6">
>       <input type="hidden" name="vidmarca" value="2">
>       <input type="hidden" name="vserial" value="A2345X">
>       <input type="hidden" name="vserialuc" value="UC2003">
>       <input type="hidden" name="vidproveedor" value="2">
>       <input type="hidden" name="vprecio" value="3500000">
>       <input type="hidden" name="vfechacompra" value=20031012>
>       <input type="hidden" name="vdescripcion" value="BORRAR">
>       <br>
>       <input type="submit" value="submit">
>     </form>
>  <dtml-var std_footer>
> </dtml-method>
> 
> the error occurs with the field vfechacompra, fechacompra is a date field on 
> postgres table.
> 
> when test my sql-method on ZMI all is OK, but not with the dtml-method
> 
> <sql-method>
>  <arguments>
>    vidtipo
>    vidsubzona
>    vidmarca
>    vserial
>    vserialuc
>    vidproveedor
>    vprecio
>    vfechacompra
>    vdescripcion
>  </arguments>
> 
> insert into equipo 
>                   (idtipo,
>                    idubicacion,
>                    idmarca,
>                    serial,
>                    serialuc,
>                    idproveedor,
>                    precio,
>                    fechacompra,
>                    descripcion) 
>       values (<dtml-sqlvar vidtipo type="int">,
>                    <dtml-sqlvar vidsubzona type="int">,
>                    <dtml-sqlvar vidmarca type="int">,
>                    <dtml-sqlvar vserial type="string">,
>                    <dtml-sqlvar vserialuc type="string">,
>                    <dtml-sqlvar vidproveedor type="int">,
>                    <dtml-sqlvar vprecio type="nb">,
>                    <dtml-sqlvar vfechacompra type="string">,
>                    <dtml-sqlvar vdescripcion type="string">)
> </sql-method> 







More information about the Zope mailing list