This query ran fine in 10.2.0.4. Now that I'm using 11g, It gives me an error ORA-01790
The problem is product_manager_user_id is stored as a varchar(150), all other user ids are stored as a number. What I think is strange is that adding to_number to the first subquery fixes the problem
This doesn't seem right to me. Is this the expected behavior? Why did the original query break when moved to 11g? Thanks.
-----------------------------------------
I cannot be bought. Find leasing information at
Code:
SELECT emp.oracle_user_id AS value_passed,
emp.full_name AS display_name
FROM employee_ref emp
WHERE EXISTS(SELECT 'x'
FROM action_history ah
WHERE ah.assigned_to_user_id = emp.oracle_user_id
AND ah.status = 'OPEN')
OR EXISTS(SELECT 'x'
FROM MANUFACTURER_VW mfr
WHERE mfr.product_manager_user_id = emp.oracle_user_id)
ORDER BY emp.full_name ASC
The problem is product_manager_user_id is stored as a varchar(150), all other user ids are stored as a number. What I think is strange is that adding to_number to the first subquery fixes the problem
Code:
SELECT emp.oracle_user_id AS value_passed,
emp.full_name AS display_name
FROM employee_ref emp
WHERE EXISTS(SELECT 'x'
FROM action_history ah
WHERE to_number(ah.assigned_to_user_id) = to_number(emp.oracle_user_id)
AND ah.status = 'OPEN')
OR EXISTS(SELECT 'x'
FROM MANUFACTURER_VW mfr
WHERE mfr.product_manager_user_id = emp.oracle_user_id)
ORDER BY emp.full_name ASC
-----------------------------------------
I cannot be bought. Find leasing information at