[Zope] mySQL - Z SQL - dtml-var

Dieter Maurer dieter@handshake.de
Tue, 18 Jul 2000 01:25:29 +0200 (CEST)


Gijs Reulen writes:
 > INSERT INTO test1
 > ( id, content, phone )
 > VALUES (
 > <dtml-var 12.12>,
 > <dtml-sqlvar content type=nb>,
 > <dtml-sqlvar phone type=nb optional>
 > )
 > 
 > According to the doc I should be able to use dtml-var statements in Z SQL
 > Methods. However, this returns an error: Error, exceptions.KeyError: 12.12
This is indeed a strange variable name (12.12).

Do you mean the floating point value 12.12 rather than a variable of
this name?

In this case, you should use:
  <dtml-var "12.12">

 > I also tried:
 > INSERT INTO test1
 > ( id, content, phone )
 > VALUES (
 > <dtml-sqlvar id type=float>,
 > <dtml-sqlvar content type=nb>,
 > <dtml-sqlvar phone type=nb optional>
 > )
 > 
 > This also retuns an error: Error, exceptions.ValueError: Invalid
 > floating-point value for id
Obviously, "id" does not contain a floating point value.



Dieter