Quantcast

parameter - partition

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

parameter - partition

Slawek
Hello,
I would like to execute on oracle database query like it:
<select id="some_query" parametertype="myClass">
select first_name, second_name
from customer table partition(#{partition})
where id>100
</select>
Parameter class myClass has string field partition, which is set to
name real oracle partition. Unfortunetly correct oracle sql statement
don't allow use brackets in partition name, so eg. correct is:
select first_name, second_name
from customer table partition(2012_partition)
where id>100
But incorrect is:
select first_name, second_name
from customer table partition("2012_partition")
where id>100
But in this case mybatis always add brackets to partion name, becouse
it is string type. I haven't idea how to resolve this problem - but
this feature is to me very important.

Best Regards
sw
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: parameter - partition

Eduardo Macarron
Try with $:

<select id="some_query" parametertype="myClass">
select first_name, second_name
from customer table partition(${partition})
where id>100
</select>

On 21 mar, 21:03, Slawek <[hidden email]> wrote:

> Hello,
> I would like to execute on oracle database query like it:
> <select id="some_query" parametertype="myClass">
> select first_name, second_name
> from customer table partition(#{partition})
> where id>100
> </select>
> Parameter class myClass has string field partition, which is set to
> name real oracle partition. Unfortunetly correct oracle sql statement
> don't allow use brackets in partition name, so eg. correct is:
> select first_name, second_name
> from customer table partition(2012_partition)
> where id>100
> But incorrect is:
> select first_name, second_name
> from customer table partition("2012_partition")
> where id>100
> But in this case mybatis always add brackets to partion name, becouse
> it is string type. I haven't idea how to resolve this problem - but
> this feature is to me very important.
>
> Best Regards
> sw
Loading...