You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Henry Lu <zh...@umich.edu> on 2006/03/07 19:42:19 UTC

# in select statement

I have a SQL statement:

   <select id="select_drda_list"
           resultClass="utilmisc.NameValue">
<![CDATA[
select unique prpsl_# as m_name, prpsl_# as m_value
from
prism_funding
where prpsl_## is not null
and prpsl_## not in
(select proposal_number from training_grant
where proposal_number is not null)
order by 1
]]>
   </select>

And I got the following error:

Caused by: com.ibatis.sqlmap.client.SqlMapException: Incorrect in
line parameter map format (missmatched name=value pairs):
  as m_name, prpsl_
Caused by: com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMap/select'. 
Cause: com.ibatis.sqlmap.client.SqlMapException:
Incorrect inline parameter map format (missmatched name=value pairs):
  as m_name, prpsl_
Caused by: com.ibatis.sqlmap.client.SqlMapException: Incorrect in
line parameter map format (missmatched name=value pairs):  as m_name, prpsl_
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletPar

How do I fix it?

-Henry

Re: # in select statement

Posted by Ted Schrader <ts...@gmail.com>.
Hi Henry,

Escape your # with ##.

>> select unique prpsl_## as m_name, prpsl_## as m_value ....

Ted

On 07/03/06, Henry Lu <zh...@umich.edu> wrote:
> I have a SQL statement:
>
>    <select id="select_drda_list"
>            resultClass="utilmisc.NameValue">
> <![CDATA[
> select unique prpsl_# as m_name, prpsl_# as m_value
> from
> prism_funding
> where prpsl_## is not null
> and prpsl_## not in
> (select proposal_number from training_grant
> where proposal_number is not null)
> order by 1
> ]]>
>    </select>
>
> And I got the following error:
>
> Caused by: com.ibatis.sqlmap.client.SqlMapException: Incorrect in
> line parameter map format (missmatched name=value pairs):
>   as m_name, prpsl_
> Caused by: com.ibatis.common.exception.NestedRuntimeException:
> Error parsing XPath '/sqlMap/select'.
> Cause: com.ibatis.sqlmap.client.SqlMapException:
> Incorrect inline parameter map format (missmatched name=value pairs):
>   as m_name, prpsl_
> Caused by: com.ibatis.sqlmap.client.SqlMapException: Incorrect in
> line parameter map format (missmatched name=value pairs):  as m_name, prpsl_
> at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletPar
>
> How do I fix it?
>
> -Henry
>