You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Subadhra Jagannathan <su...@gmail.com> on 2008/03/10 19:27:21 UTC

orderBy clause failing to accept an alias

Hello, All,

I am new to torque. In the new torque release, the change log says --
"OrderBy now accepts column names without a dot. No additional processing is
made for these".

But I am trying to use an alias with the orderBy clause and it fails with
"removeSQLFunction() : Column name mz ASC does not contain a . or a *"
message. How do I circumvent this?

Thanks a lot.
Subadhra

RE: orderBy clause failing to accept an alias

Posted by Thomas Fischer <fi...@seitenbau.net>.
For simple queries as yours this should work, regardless of the patch.

Yan you please describe what you want to do and how you are trying to do it
?

    Thomas

"Greg Monroe" <Gr...@DukeCE.com> schrieb am 10.03.2008 20:00:19:

> Hmm, this looks to be a bit of a book work error.  I traced this back
> to the Torque-89 Jira issue.  This is still open because the
> reporting user never replied that the patch worked.  And no test
> case to verify it was created.
>
> However, in looking over the changes, it looks like one part of
> the requested change was not made.  In the SQLBuilder processOrderBy
> method, there is a call to removeSQLFunction(...).  This will return
> the exception you are seeing.
>
> The missing part is a try / catch around this call with the catch
> part using the original column name.  See:
>
> http://issues.apache.org/jira/browse/TORQUE-89?focusedCommentId=12488935
> #action_12488935
>
> > -----Original Message-----
> > From: Subadhra Jagannathan [mailto:subadhra.jagannathan@gmail.com]
> > Sent: Monday, March 10, 2008 2:27 PM
> > To: Apache Torque Users List
> > Subject: orderBy clause failing to accept an alias
> >
> > Hello, All,
> >
> > I am new to torque. In the new torque release, the change log says --
> > "OrderBy now accepts column names without a dot. No additional
> > processing is
> > made for these".
> >
> > But I am trying to use an alias with the orderBy clause and it fails
> > with
> > "removeSQLFunction() : Column name mz ASC does not contain a . or a *"
> > message. How do I circumvent this?
> >
> > Thanks a lot.
> > Subadhra
> DukeCE Privacy Statement:
> Please be advised that this e-mail and any files transmitted with
> it are confidential communication or may otherwise be privileged or
> confidential and are intended solely for the individual or entity
> to whom they are addressed. If you are not the intended recipient
> you may not rely on the contents of this email or any attachments,
> and we ask that you please not read, copy or retransmit this
> communication, but reply to the sender and destroy the email, its
> contents, and all copies thereof immediately. Any unauthorized
> dissemination, distribution or copying of this communication is
> strictly prohibited.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


RE: orderBy clause failing to accept an alias

Posted by Greg Monroe <Gr...@DukeCE.com>.
Hmm, this looks to be a bit of a book work error.  I traced this back
to the Torque-89 Jira issue.  This is still open because the 
reporting user never replied that the patch worked.  And no test
case to verify it was created.

However, in looking over the changes, it looks like one part of 
the requested change was not made.  In the SQLBuilder processOrderBy
method, there is a call to removeSQLFunction(...).  This will return
the exception you are seeing.

The missing part is a try / catch around this call with the catch
part using the original column name.  See:

http://issues.apache.org/jira/browse/TORQUE-89?focusedCommentId=12488935
#action_12488935

> -----Original Message-----
> From: Subadhra Jagannathan [mailto:subadhra.jagannathan@gmail.com]
> Sent: Monday, March 10, 2008 2:27 PM
> To: Apache Torque Users List
> Subject: orderBy clause failing to accept an alias
> 
> Hello, All,
> 
> I am new to torque. In the new torque release, the change log says --
> "OrderBy now accepts column names without a dot. No additional
> processing is
> made for these".
> 
> But I am trying to use an alias with the orderBy clause and it fails
> with
> "removeSQLFunction() : Column name mz ASC does not contain a . or a *"
> message. How do I circumvent this?
> 
> Thanks a lot.
> Subadhra
DukeCE Privacy Statement:
Please be advised that this e-mail and any files transmitted with
it are confidential communication or may otherwise be privileged or
confidential and are intended solely for the individual or entity
to whom they are addressed. If you are not the intended recipient
you may not rely on the contents of this email or any attachments,
and we ask that you please not read, copy or retransmit this
communication, but reply to the sender and destroy the email, its
contents, and all copies thereof immediately. Any unauthorized
dissemination, distribution or copying of this communication is
strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org