Error using Query Parameters with cfscript query

前端 未结 3 1198
后悔当初
后悔当初 2021-01-17 18:27

Here is my code:

var qryStr = \"
            UPDATE templates_email 
            SET title = :title, test_emails = :testEmail, body = :body
            WHERE         


        
3条回答
  •  轮回少年
    2021-01-17 18:50

    The parser for getting the params doesn't tokenize on return values, only on whitespace (which is really annoying). Try the following:

    var qryStr = "
        UPDATE templates_email 
        SET title = ( :title ), test_emails = ( :testEmail ), body = ( :body )
        WHERE ( id = :templateID )
    ";
    

    The ( and ) should remove any issue with where the parser not being able to recognise where the :params stop and start.

提交回复
热议问题