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 Chema <ch...@gmail.com> on 2006/03/29 12:00:24 UTC
Views and dynamic queries
Hello:
I've got this query in sqlmap config file
<select remapResults ="true" id="getValue" resultClass="java.lang.Object"
parameterClass="QueryClass">
SELECT $c$
FROM $table$
WHERE $where$
</select>
If $table$ is the name of a view , this error happens:
ORA-00921: unexpected end of SQL command
If $table$ is the name of a table, all works fine
why ?
Thanks in advance
Best regards
Re: Views and dynamic queries
Posted by Jeff Butler <je...@gmail.com>.
http://opensource.atlassian.com/confluence/oss/display/IBATIS/Frequently+Asked+Questions
Jeff Butler
On 3/30/06, Chema <ch...@gmail.com> wrote:
>
>
> And how I can to log the iBatis query generated ?
>
>
> 2006/3/29, Diran Ayandele <Ad...@sun.com>:
>
> > This is probably a syntax error in your sql. That error message from
> > oracle often indicates a comma in the wrong place or parenthesis that is
> > unmatched. I would use your logs to see exactly what sql you're sending
> >
> > to your database. Or else run your statements using sqlplus to see a
> > nice carat under the exact syntax problem.
> >
> > Diran
> >
> > Chema wrote:
> >
> > >
> > > Not, it isn't
> > >
> > > The name is VIEW_JOB ( but the table name is FUTURE_JOB and works
> > fine )
> > >
> > >
> > >
> > >
> > > 2006/3/29, Larry Meadors <lmeadors@apache.org
> > > <ma...@apache.org>>:
> > >
> > > Does the view name have a # or $ character in it?
> > >
> > > Larry
> > >
> > >
> > > On 3/29/06, Chema < chemagogia@gmail.com
> > > <mailto: chemagogia@gmail.com>> wrote:
> > > > Hello:
> > > >
> > > > I've got this query in sqlmap config file
> > > >
> > > > <select remapResults ="true" id="getValue" resultClass="
> > > java.lang.Object"
> > > > parameterClass="QueryClass">
> > > > SELECT $c$
> > > > FROM $table$
> > > > WHERE $where$
> > > > </select>
> > > >
> > > >
> > > >
> > > > If $table$ is the name of a view , this error happens:
> > > > ORA-00921: unexpected end of SQL command
> > > >
> > > > If $table$ is the name of a table, all works fine
> > > >
> > > > why ?
> > > >
> > > > Thanks in advance
> > > >
> > > > Best regards
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
>
>
>
Re: Views and dynamic queries
Posted by Chema <ch...@gmail.com>.
And how I can to log the iBatis query generated ?
2006/3/29, Diran Ayandele <Ad...@sun.com>:
>
> This is probably a syntax error in your sql. That error message from
> oracle often indicates a comma in the wrong place or parenthesis that is
> unmatched. I would use your logs to see exactly what sql you're sending
> to your database. Or else run your statements using sqlplus to see a
> nice carat under the exact syntax problem.
>
> Diran
>
> Chema wrote:
>
> >
> > Not, it isn't
> >
> > The name is VIEW_JOB ( but the table name is FUTURE_JOB and works fine
> )
> >
> >
> >
> >
> > 2006/3/29, Larry Meadors <lmeadors@apache.org
> > <ma...@apache.org>>:
> >
> > Does the view name have a # or $ character in it?
> >
> > Larry
> >
> >
> > On 3/29/06, Chema < chemagogia@gmail.com
> > <ma...@gmail.com>> wrote:
> > > Hello:
> > >
> > > I've got this query in sqlmap config file
> > >
> > > <select remapResults ="true" id="getValue" resultClass="
> > java.lang.Object"
> > > parameterClass="QueryClass">
> > > SELECT $c$
> > > FROM $table$
> > > WHERE $where$
> > > </select>
> > >
> > >
> > >
> > > If $table$ is the name of a view , this error happens:
> > > ORA-00921: unexpected end of SQL command
> > >
> > > If $table$ is the name of a table, all works fine
> > >
> > > why ?
> > >
> > > Thanks in advance
> > >
> > > Best regards
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
Re: Views and dynamic queries
Posted by Diran Ayandele <Ad...@Sun.COM>.
This is probably a syntax error in your sql. That error message from
oracle often indicates a comma in the wrong place or parenthesis that is
unmatched. I would use your logs to see exactly what sql you're sending
to your database. Or else run your statements using sqlplus to see a
nice carat under the exact syntax problem.
Diran
Chema wrote:
>
> Not, it isn't
>
> The name is VIEW_JOB ( but the table name is FUTURE_JOB and works fine )
>
>
>
>
> 2006/3/29, Larry Meadors <lmeadors@apache.org
> <ma...@apache.org>>:
>
> Does the view name have a # or $ character in it?
>
> Larry
>
>
> On 3/29/06, Chema < chemagogia@gmail.com
> <ma...@gmail.com>> wrote:
> > Hello:
> >
> > I've got this query in sqlmap config file
> >
> > <select remapResults ="true" id="getValue" resultClass="
> java.lang.Object"
> > parameterClass="QueryClass">
> > SELECT $c$
> > FROM $table$
> > WHERE $where$
> > </select>
> >
> >
> >
> > If $table$ is the name of a view , this error happens:
> > ORA-00921: unexpected end of SQL command
> >
> > If $table$ is the name of a table, all works fine
> >
> > why ?
> >
> > Thanks in advance
> >
> > Best regards
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
Re: Views and dynamic queries
Posted by Chema <ch...@gmail.com>.
Not, it isn't
The name is VIEW_JOB ( but the table name is FUTURE_JOB and works fine )
2006/3/29, Larry Meadors <lm...@apache.org>:
>
> Does the view name have a # or $ character in it?
>
> Larry
>
>
> On 3/29/06, Chema <ch...@gmail.com> wrote:
> > Hello:
> >
> > I've got this query in sqlmap config file
> >
> > <select remapResults ="true" id="getValue" resultClass="java.lang.Object
> "
> > parameterClass="QueryClass">
> > SELECT $c$
> > FROM $table$
> > WHERE $where$
> > </select>
> >
> >
> >
> > If $table$ is the name of a view , this error happens:
> > ORA-00921: unexpected end of SQL command
> >
> > If $table$ is the name of a table, all works fine
> >
> > why ?
> >
> > Thanks in advance
> >
> > Best regards
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
Re: Views and dynamic queries
Posted by Larry Meadors <lm...@apache.org>.
Does the view name have a # or $ character in it?
Larry
On 3/29/06, Chema <ch...@gmail.com> wrote:
> Hello:
>
> I've got this query in sqlmap config file
>
> <select remapResults ="true" id="getValue" resultClass="java.lang.Object"
> parameterClass="QueryClass">
> SELECT $c$
> FROM $table$
> WHERE $where$
> </select>
>
>
>
> If $table$ is the name of a view , this error happens:
> ORA-00921: unexpected end of SQL command
>
> If $table$ is the name of a table, all works fine
>
> why ?
>
> Thanks in advance
>
> Best regards
>
>
>
>
>
>
>
>
>
>
>
>
>