Hi All,
When I declare cursor with function call in the where clause, upon execution, it gives me following error:
ORA-00904: "GET_ORDER_TYPE": invalid identifier
CURSOR price_cur (p_header_id NUMBER
) IS
SELECT
ooh.order_number
, ool.line_number
, ooh.header_id
, ool.line_id
FROM oe_order_headers_all ooh
, oe_order_lines_all ool
, oe_price_adjustments_v opa
WHERE
1 = 1
AND ooh.header_id = p_header_id
AND ooh.header_id = ool.header_id
AND ooh.header_id = opa.header_id
AND ool.line_id = opa.line_id
AND get_order_type(ooh.order_type_id) = 1 --- get_order_type is a function
If I remove the line get_order_type(ooh.order_type_id) = 1 , it runs fine. get_order_type is a function inside the same package.
Let me know whether we can call function in WHERE CLAUSE OR NOT?
Thanks