Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Selecting variables into functions
dsolly_at_gmail.com wrote:
> If I have a function:
>
> select F_21_DAY_CALC(to_date('15-Dec-2004', 'dd-Mon-yyyy'), 'PETER',
> 21) from dual
>
> how can I change my variables to select from a temporary table instead?
> I.E.
>
> select F_21_DAY_CALC(select todate from temp), (select name from temp),
> (select number from temp) from dual
>
> TIA
> D
What you are trying to do makes no sense. In Oracle you should NEVER use a temporary table. Strikes me your background is SQL Server and you are trying to Microsoftize Oracle which will fail.
My suspicion is that you want some kind of join: Inner or outer but it is impossible to tell from what you've written. If you just want to query temp (a keyword and a horrible table name even for a heap table) then why include DUAL at all?
BTW: Version is important.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Mon Apr 11 2005 - 14:39:59 CDT