JSP and JSTL "sql:param" and "order by" with Oracle

Francis <[email protected]>
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <[email protected]>
Impossible to sort a select in sql:query with an "order by ?"  and 
sql:param with Oracle.

<sql:query var="stmt" dataSource="${ ig42 }" >
SELECT id_agent, nom, prenom, no_ulis, no_bureau, prof_telephone,      
serv_principal FROM perso.per_v_agent_opencms
WHERE NVL( perso.per_v_agent_opencms.date_fin_contrat , 
TO_DATE('01/01/2100','DD/MM/YYYY')) > SYSDATE
ORDER BY ?
 <sql:param value="${truc}" />
</sql:query>

I try with truc=nom or truc=2.
The var truc is tested with c:out.
With  "ORDER BY nom" or "ORDER BY 2" in the select the query is in order
Another test with  a where clause "nom like ?" and <sql:param 
value="${truc}%" /> is working with correct value of truc.
The JSP page is working but without sort.
If the text in the var truc is "xxx" it's also working without error and 
sort.

Why?

Francis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.