-
May 28th, 2012, 02:21 AM
#1
Order by arguments while selecting from a sql view
Hi,
I am trying to use the JDBCTemplate.query() method to select from a sql view.
I am passing the order by column as an arg inside the query method.
Apparently, it doesnt select using the order by column and returns non-ordered resultset.
return jTemplate.query("select * from my_view_name order by ? desc",new Object[]{"some_col"}, new MyResultSetExtractor());
The same method call works fine if I select from a table (and not a view).
I dont really want to do a replace(? with the column name) in the sql query.
Appreciate the assistance.
Cheers!
Dev
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules