Field is a reserved word in cfqueryparam

A workflow application I recently worked on tracks workflow between two groups, a legal group and a group working in the field. I aptly named the groups "legal" and "field".

This turned out to cause problems when using cfqueryparam. The column was a varchar column so I would imagine the text 'FIELD' would be just another string of text

Instead:

view plain print about
1Macromedia][SQLServer JDBC Driver]Unsupported data conversion.
2
3SELECT TOP 1 TimeCardID, ObjectID, UserID,
4UserType, DateTimeIn, DateTimeOut, DateCreated FROM
5TimeCard WHERE ObjectID = (param 1) AND UserType =
6(param 2) ORDER BY DateCreated
7
8
9(param 1) = [type='IN', class='java.lang.String',
10value='72FAE9F0-16D4-3001-353F84B2E749664D', sqltype='cf_sql_varchar']
11, (param 2) = [type='IN', class='java.lang.String', value='FIELD',
12sqltype='cf_sql_varchar']

I had no problem using the value 'FIELD' in the same column without cfqueryparam. It would seem something inside cfqueryparam must gets unhappy with the text string 'FIELD'

view plain print about
1SELECT TOP 1 TimeCardID, ObjectID, UserID,
2UserType, DateTimeIn, DateTimeOut, DateCreated FROM
3TimeCard WHERE ObjectID = (param 1) AND UserType =
4'FIELD' ORDER BY DateCreated
5
6
7(param 1) = [type='IN', class='java.lang.String',
8value='72FAE9F0-16D4-3001-353F84B2E749664D', sqltype='cf_sql_varchar']

Note: The word 'field' doesn't appear in the MSSQL Reserved word list nor in the SQL Reserved words checker by the illustrious Pete Freitag. Thusly, I believe this is specific to cfqueryparam only.

There are no comments for this entry.

Add Comment Subscribe to Comments