Problem with revExecuteSQL

Kay C Lan lan.kc.macmail at gmail.com
Sat Nov 3 07:07:52 EDT 2007


On 11/1/07, Dave <dave at looktowindward.com> wrote:
>
> Hi,
>
> I am getting an invalid token error from revExecuteSQL, when I look
> at the data being inserted, it contains a ":" character following by
> a number (a date field in the form DD:MM:YY. How do I insert this data?


You didn't mention if you were using mySQL or some other flavour, but
assuming that you are, then DD:MM:YY is not a valid date format. You may
need to redefine your db column as a VARCHAR column and do all the data
validation in Rev, or you need to ensure dates are entered in the mySQL
valid YYYY-MM-DD format.

See the mySQL manual, Chapter 11.3.1 The DATETIME, DATE and TIMESTAMP types.
Two short quotes:

Starting from MySQL 5.0.2, MySQL gives warnings/errors if you try to insert
an illegal date.

• The relaxed format allowed for values specified as strings can be
deceiving. For example, a value such as '10:11:12' might look like a time
value because of the ':' delimiter, but if used in a date context is
interpreted as the year '2010-11-12'. The value '10:45:15' is converted to
'0000-00-00' because '45' is not a legal month.

 HTH



More information about the Use-livecode mailing list