[ 
https://issues.apache.org/jira/browse/IBATIS-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654860#action_12654860
 ] 

Kai Grabfelder commented on IBATIS-558:
---------------------------------------

could you please check if this happens with the latest iBATIS version as well?



> Field name with # not supported without parameters
> --------------------------------------------------
>
>                 Key: IBATIS-558
>                 URL: https://issues.apache.org/jira/browse/IBATIS-558
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: SQL Maps
>    Affects Versions: 2.3.0
>         Environment: iOS v5r3
>            Reporter: M.H. Avegaart
>            Priority: Critical
>
> Assume I have a field named FIELD#. To use this field in SQL I need to 
> duplicate the # character (as mentioned in the iBatis FAQ).
> The following statement works:
> <select id="..." parameterClass="..." resultMap="...">
>       select FIELD##
>       from SCHEMA.TABLE
>       where OTHER_FIELD = #value#
> </select>
> But to my surprise, this one doesn't:
> <select id="..." parameterMap="..." resultMap="...">
>       select FIELD##
>       from SCHEMA.TABLE
>       where OTHER_FIELD = ?
> </select>
> (DB2 complains that FIELD## can't be found in SCHEMA.TABLE)
> Apparently the ## is only replaced by # if the SQL string also contains at 
> least one #parameter#.
> ps. Before you ask, using a single # is also not supported:
> <select id="..." parameterMap="..." resultMap="...">
>       select FIELD#
>       from SCHEMA.TABLE
>       where OTHER_FIELD = ?
> </select>
> (iBatis complains that "from SCHEMA.TABLE where OTHER_FIELD = ?" is not a 
> parameter)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to