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: fill SQL string variable without single quotes
Date Wed, 02 Mar 2005 23:47:03 GMT
Use substitution instead:

     <statement id="getFieldList">
       show columns from $table$ from $schema$
     </statement>

It is in the users guide...

Larry


On Wed, 2 Mar 2005 16:58:58 -0500, Peter Cai <petercaito@yahoo.com.cn> wrote:
>  
> Hi,
> 
> I used this mapping to get the schema information for a table:
> 
> 
>     <parameterMap id="select-field-para" class="fieldParameter">
>       <parameter property="table" />
>       <parameter property="schema" />
>     </parameterMap>
> 
>     <statement id="getFieldList" parameterMap="select-field-para">
>       show columns from ? from ?
>     </statement>
> 
> 
> 
> when I set table="product" schema="jpetstore" in fieldParameter class (both 
> schema and table are java String type). I really want a sql statement like 
> this
> 
>     " show columns from product from jpetstore "
> 
> But iBATIS will generate a statement like this:
> 
>     " show columns from 'product' from 'jpetstore' "
> 
> So MySQL database always complaint an error.
> 
> How to fix it?
> 
> Thank you very much!
> 
> Peter
> 
>

Mime
View raw message