z Sql method and data type on insert...
Hi all, I want to use formulator + z sql method to insert data to a Mysql db. Got the form setup, but I have some fieldS that are "textarea" field type in the form, blob in my DB. The problem is that in the sql insert command, the following: "<dtml-sqlvar instructions_recette type="blob">" is not recognized by the Z sql method. Also, what are the valid data type for zsql method? The only one I could find where string or int. Thanks in advance, Francois Francois Meehan, Systems Administrator Sky Eye America, francois.m@sky-eye.com
Le Mon, Oct 15, 2001 at 09:28:35PM -0400, Francois Meehan pianota:
The problem is that in the sql insert command, the following: "<dtml-sqlvar instructions_recette type="blob">" is not recognized by the Z sql method.
Also, what are the valid data type for zsql method? The only one I could find where string or int.
You've missed float and nb. See Zope Help - DTML reference - sqlvar sqlvar: Inserts SQL variables The type of the variable. Valid types include: string, int, float and nb. nb means non-blank string. The type attribute is required and is used to properly escape inserted variable. Those are Python types, not DB types. I guess "text" would be a judicious choice for a textarea, but I'm not MySQL-blob user so I can't guarantee it will do. Let us know. Denis -- Denis FRERE P3B : Club Python(-Zope) Belge --------- http://www.p3b.org OS3B : Club Open-Software(-Linux) Carolo http://www.os3b.org Aragne : Python-Zope Solutions & Formations http://www.aragne.com
Thanks Denis, Followed your suggestion and it worked. Regards, Francois -----Original Message----- From: Denis FRERE [mailto:spirou@carolo.net] Sent: October 15, 2001 9:44 PM To: Francois Meehan Cc: zope@zope.org; formulator-general@lists.sourceforge.net Subject: Re: [Formulator-general] z Sql method and data type on insert... Le Mon, Oct 15, 2001 at 09:28:35PM -0400, Francois Meehan pianota:
The problem is that in the sql insert command, the following: "<dtml-sqlvar instructions_recette type="blob">" is not recognized by the Z sql method.
Also, what are the valid data type for zsql method? The only one I could find where string or int.
You've missed float and nb. See Zope Help - DTML reference - sqlvar sqlvar: Inserts SQL variables The type of the variable. Valid types include: string, int, float and nb. nb means non-blank string. The type attribute is required and is used to properly escape inserted variable. Those are Python types, not DB types. I guess "text" would be a judicious choice for a textarea, but I'm not MySQL-blob user so I can't guarantee it will do. Let us know. Denis -- Denis FRERE P3B : Club Python(-Zope) Belge --------- http://www.p3b.org OS3B : Club Open-Software(-Linux) Carolo http://www.os3b.org Aragne : Python-Zope Solutions & Formations http://www.aragne.com
participants (2)
-
Denis FRERE -
Francois Meehan