ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <larry.mead...@gmail.com>
Subject Re: WHERE clause with full parameter condition send
Date Fri, 21 Nov 2008 14:32:48 GMT
You'll have to use $condition$ instead. Be careful that you protect
against SQL injection.

Larry


On Fri, Nov 21, 2008 at 6:12 AM, Betto McRose Gamarra
<icarusdb@gmail.com> wrote:
> hi,
>
> well, I have a problem when I send the whole condition for the WHERE clause
>
> this is the xml config:
>
>    <select id="getSqlResult" resultClass="java.util.Map"
> parameterClass="java.util.Map">
>        <![CDATA[
>            SELECT
>                ID,
>                $columName$ AS DESCRIPTION
>
>            FROM
>                $tableName$
>        ]]>
>            <dynamic prepend="WHERE">
>              <isNotNull prepend="WHERE" property="condition">
>                  #condition#
>              </isNotNull>
>            </dynamic>
>    </select>
>
> every property has a value, I could check that
>
> the problem is because I don't have condition= #condition#
> and I get this error:
> ERROR [STDERR] com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred while applying a parameter map.
> --- Check the Ref.getSqlResult-InlineParameterMap.
> --- Check the statement (query failed).
> --- Cause: java.sql.SQLException: ORA-00920: invalid relational operator
>
>
>
> I checked the sql string before calling to sqlExecuteQuery() method in
> MappedStatement class
> this is the result:
>
> SELECT ID,  DOC_NAME AS DESCRIPTION FROM DOCUMENT WHERE ?
>
> as you can see, the only missing part is the where clause I send
>
> the value in the HashMap is filled, I also check that
>
> what is the solution for this ?
>
> --
> Betto McRose Gamarra
> IcarusDB
> "Soluciones Informáticas"
> Cel.: +595 992 686947
>

Mime
View raw message