Returning data from a function to a select -
06-04-2008
, 11:39 AM
How do you return data from a function which can then be used in
a SELECT?
Here's a simplified version of what I'm trying to do. Basically, I'm
trying to select all employees which belong to group 10, *or* to any
subgroup of group 10.
SELECT employee_id FROM employee_table
WHERE employee_group = 10 OR employee_group IN
(
SELECT get_all_subgroups(10) FROM DUAL
)
The get_all_subgroups() function is written and it performs correctly,
except it returns its data as an ARRAY, which apparently isn't the correct
way to pass data back to a SELECT.
Thanks for any suggestions. I'm using Oracle, version 10g if that matters.
--
John Gordon A is for Amy, who fell down the stairs
gordon (AT) panix (DOT) com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies" |