Working with sqlvar type=float
I used the ZPublisher to convert a variable into a type float(see input field below). I passed the variable "balance" to a ZSQL method where balance was set as type=float. I keep getting an "invalid floating point type error" when i called the updateBal ZSQ method. I even tried to convert balance with _.float(balance) but still get the same error. The mysql db field for balance is set as type float. Can someone help me please? <input type="text" name="rec.balance:float:ignore_empty:records" value=""> --------------------------------- <dtml-in rec mapping> <dtml-call "updateBal(balance=balance,Cust_ID=Cust_ID)"> </dtml-in> -------------------------------- ZSQL Method: updateBal UPDATE customers SET balance=<dtml-sqlvar balance type=float> WHERE Cust_ID=<dtml-sqlvar Cust_ID type=nb> -------------------------------- Thanks, Mike -------------------------------------------------------
Mike Doanh Tran wrote at 2003-10-20 13:58 -0600:
I used the ZPublisher to convert a variable into a type float(see input field below). I passed the variable "balance" to a ZSQL method where balance was set as type=float. I keep getting an "invalid floating point type error" when i called the updateBal ZSQ method. I even tried to convert balance with _.float(balance) but still get the same error. The mysql db field for balance is set as type float. Can someone help me please?
<input type="text" name="rec.balance:float:ignore_empty:records" value=""> --------------------------------- <dtml-in rec mapping>
The mapping may be wrong. A record exposes its content as attributes (although I am not sure whether you get it via "getitem", too). Dieter
Thanks for your suggestions. getitem give me the error message below. Does anyone else have anyother suggestion that could help me solve this? Thanks, Mike TypeError: expected string or Unicode object, ImplicitAcquirerWrapper found ----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Mike Doanh Tran" <mtran@shufflemasterrd.com> Cc: <zope@zope.org> Sent: Tuesday, October 21, 2003 2:10 PM Subject: Re: [Zope] Working with sqlvar type=float
Mike Doanh Tran wrote at 2003-10-20 13:58 -0600:
I used the ZPublisher to convert a variable into a type float(see input field below). I passed the variable "balance" to a ZSQL method where balance was set as type=float. I keep getting an "invalid floating point type error" when i called the updateBal ZSQ method. I even tried to convert balance with _.float(balance) but still get the same error. The mysql db field for balance is set as type float. Can someone help me please?
<input type="text" name="rec.balance:float:ignore_empty:records" value=""> --------------------------------- <dtml-in rec mapping>
The mapping may be wrong. A record exposes its content as attributes (although I am not sure whether you get it via "getitem", too).
Dieter
Mike Tran wrote at 2003-10-22 12:56 -0600:
Thanks for your suggestions. getitem give me the error message below. Does anyone else have anyother suggestion that could help me solve this? Thanks, Mike
TypeError: expected string or Unicode object, ImplicitAcquirerWrapper found
This does not look like as it resulted from dropping the "mapping" attribute (or your records have really weird content). Did you look at the traceback? (--> "Root Folder" --> "error_log"). Maybe, your "rec" it taken from somewhere else than the request object. Try "<dtml-in expr="REQUEST.rec">'. Dieter
participants (3)
-
Dieter Maurer -
Mike Doanh Tran -
Mike Tran