db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From T E Schmitz <mail...@numerixtechnology.de>
Subject Re: order by col1, col2 nulls first ??
Date Mon, 23 Jan 2006 10:05:15 GMT

assuming COL2 is numeric:

ORDER BY COL1, coalesce (COL2,0)

which translates to

criteria.addAscendingOrderByColumn(COL1);
criteria.addAscendingOrderByColumn("coalesce (COL2,0)");

I can't remember whether I had to patch Torque to accept the above 
character string.

> "Garret O'Kelly" <garretokelly@beaumont.ie> schrieb am 20.01.2006 13:30:26:
>>What I want is
>>... order by col1, col2 asc nulls first
>>
>>
>>I've tried
>>criteria.addAscendingOrderByColumn(MyPeer.COL1);
>>criteria.addAscendingOrderByColumn("col2 nulls first");
>>
>>but this gives:
>>... order by col1 asc, col2 nulls first asc
>>which is invalid for Oracle
>>
>>I've also tried
>>criteria.addAscendingOrderByColumn(MyPeer.COL1);
>>criteria.getOrderByColumns.add("col2 nulls first asc");
>>
>>but that also gives an exception
>>
>>I'm using torque 3.0 btw

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


Mime
View raw message