|
Hi should'nt this work:
@Select("Select floatColumn from table where enddatetime > #{from} and enddatetime > #{from} ")
public float selectTotalServiceLevelData(Date from); I mean using the parameter 2 times? regards Nino
|
|
Yes - add an @Param annotation to the method parameter and it will.
On Tue, Oct 19, 2010 at 6:53 AM, nino martinez wael <[hidden email]> wrote: > Hi should'nt this work: > @Select("Select floatColumn from table where enddatetime > #{from} and > enddatetime > #{from} ") > public float selectTotalServiceLevelData(Date from); > I mean using the parameter 2 times? > regards Nino |
|
In reply to this post by nino martinez wael
On 10/19/2010 8:53 AM, nino martinez wael wrote:
> Hi should'nt this work: > > @Select("Select floatColumn from table where enddatetime > #{from} and > enddatetime > #{from} ") > public float selectTotalServiceLevelData(Date from); > > I mean using the parameter 2 times? Yes. -- Guy Rouillier |
|
Hmm ok, I've now put in the params as proposed, and I get a different error.
I've tested the query and it works from SQL squirrel. I guess the question are that how do I map between the SQL fragment : TO_DATE(\"#{from}\", \"%Y-%m-%d %H:%M\") and @Param("from") Date from. Should I somehow also specify a date format, or should I change it to a string instead? What is best practice?
-Nino 2010/10/20 Guy Rouillier <[hidden email]>
|
|
Ok, I've now put in the params as proposed, and I get a different error .
I've tested the query and it works from SQL squirrel.
I guess the question are that how do I map between the SQL fragment : TO_DATE(\"#{from}\", \"%Y-%m-%d %H:%M\") and @Param("from") Date from. Should I somehow also specify a date format, or should I change it to a string instead? What is best practice?
-Nino 2010/10/20 nino martinez wael <[hidden email]> Hmm ok, I've now put in the params as proposed, and I get a different error. |
|
A different error? :/
Throw us a bone here. Larry On Wed, Oct 20, 2010 at 2:24 AM, nino martinez wael <[hidden email]> wrote: > Ok, I've now put in the params as proposed, and I get a different error . > I've tested the query and it works from SQL squirrel. > I guess the question are that how do I map between the SQL fragment > : TO_DATE(\"#{from}\", \"%Y-%m-%d %H:%M\") and @Param("from") Date from. > Should I somehow also specify a date format, or should I change it to a > string instead? What is best practice? > -Nino > 2010/10/20 nino martinez wael <[hidden email]> >> >> Hmm ok, I've now put in the params as proposed, and I get a different >> error. >> I've tested the query and it works from SQL squirrel. >> I guess the question are that how do I map between the SQL fragment >> : TO_DATE(\"#{from}\", \"%Y-%m-%d %H:%M\") and @Param("from") Date from. >> Should I somehow also specify a date format, or should I change it to a >> string instead? What is best practice? >> -Nino >> >> 2010/10/20 Guy Rouillier <[hidden email]> >>> >>> On 10/19/2010 8:53 AM, nino martinez wael wrote: >>>> >>>> Hi should'nt this work: >>>> >>>> @Select("Select floatColumn from table where enddatetime > #{from} and >>>> enddatetime > #{from} ") >>>> public float selectTotalServiceLevelData(Date from); >>>> >>>> I mean using the parameter 2 times? >>> >>> Yes. >>> >>> -- >>> Guy Rouillier >> > > |
|
yeah I get sql syntax error :( probably because the Date is'nt formatted correctly..
2010/10/20 Larry Meadors <[hidden email]> A different error? :/ |
| Powered by Nabble | Edit this page |
