tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis <ffrai...@met.wallonie.be>
Subject JSP and JSTL "sql:param" and "order by" with Oracle
Date Fri, 07 Apr 2006 09:53:41 GMT
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


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


Mime
View raw message