dbTalk Databases Forums  

Returning data from a function to a select

comp.databases comp.databases


Discuss Returning data from a function to a select in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Gordon
 
Posts: n/a

Default 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"


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.