Back Forum Reply New

prepared statement: order by ? and select top ?

Is it not possible to use SELECT TOP ? and ORDER BY ? in prepared statements?

I have a query that I try to execute trought the jdbcTemplateCode:
this.jdbcTemplate.query(quot;Select top ? A.ASSETID assetId where name = ? order by ?quot; ),
new Object[] { 10, quot;fooquot;, quot;assetIdquot;},
new RowMapper() { ........
I get an execption that there is a syntax error near parameter @p1

sprin...xRows%28int%29
¥
Back Forum Reply New