Skip to main content
Participant
September 12, 2008
Question

cfqueryparam error with empty string

  • September 12, 2008
  • 1 reply
  • 361 views
Hi all - One of our legacy servers is running CF 5.0 against a MySQL 4.0.16 MYISAM table. I am attempting to use cfqueryparam to insert a passed form variable to a varchar field that does not allow NULL, as shown in the example. If the form variable happens to contain the empty string then I receive the following error:
ODBC Error Code = 94 ()
[MERANT][ODBC MySql driver]6053

I have retried the query with the cfqueryparam parameter, null="no", and get the same error. If I remove the cfqueryparam altogether and just insert the empty string then it works fine. I am convinced that the syntax of the INSERT is not at fault, but can't figure out what is.

Can anyone enlighten me?

    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    ZudigekAuthor
    Participant
    September 12, 2008
    I find that if I change the cfsqltype to "cf_sql_longvarchar" then the insert works. This should not be necessary, though, because the column into which the data is being inserted is defined as varchar(80). Plus, I don't feel comfortable using that, so any other info you all have would be appreciated.