ORA-1722 Extrange error
596416Sep 18 2007 — edited Sep 19 2007Hello,
I have an strange error. I defined some Popup Key LOV (Displays description, returns key value) items. I want these items get an specific value, depending on a primary key value.
In one of these items, i define the List of Values as:
select '(' || ID_RED_VENTAS || ') ' || APELLIDOS_EMP || ', ' || NOMBRE_EMP display_value, ID_RED_VENTAS return_value
from TI_RED_VENTAS
WHERE ID_FOTO = 0
order by APELLIDOS_EMP, NOMBRE_EMP.
I want it selects automatically the correct value, so I declare the Source Type as SQL Query and the Source Expression as:
_____
select '(' || TO_NUMBER(Ti_Red_Ventas.ID_RED_VENTAS) || ') ' || Ti_Red_Ventas.APELLIDOS_EMP || ', ' || Ti_Red_Ventas.NOMBRE_EMP display_value,
TO_NUMBER(Ti_Red_Ventas.ID_RED_VENTAS) return_value
FROM TI_RED_VENTAS, Ti_Parametros_Ra
WHERE TO_NUMBER(Ti_Red_Ventas.Id_Foto) = 0
AND (TO_NUMBER(ti_red_ventas.id_red_ventas) = TO_NUMBER(ti_parametros_ra.id_red_ventas))
AND (TO_NUMBER(ti_parametros_ra.id_parametro) = TO_NUMBER(:P62_ID_PARAMETRO))
AND ROWNUM = 1
ORDER BY Ti_Red_Ventas.APELLIDOS_EMP, Ti_Red_Ventas.NOMBRE_EMP
_____
where P62_ID_PARAMETRO contains the primary key of the selected item.
This query works fine with the PL/SQL Developer software, but it returns the next error when I debug it with APEX:
Error: ORA-01722: invalid number performing List of Values query: "select DISPLAY_VALUE, RETURN_VALUE from (select '(' || ID_RED_VENTAS || ') ' || APELLIDOS_EMP || ', ' || NOMBRE_EMP display_value, ID_RED_VENTAS return_value from TI_RED_VENTAS WHERE ID_FOTO = 0 order by APELLIDOS_EMP, NOMBRE_EMP ) wwvlovinlineviewname where RETURN_VALUE = :WWV_LOV_RETURN_KEY_UTIL_1111".
I don't know the reason for that. I have been googling and found nothing about it.
Anybody see something strange on the queries?
Thanks in advance!!