Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Function in a WHERE clause
Can anyone give a definitive answer to the following?
In PL/SQL, a row has to be selected from the database on the condition that a key value matches a parameter which is first converted by another function. Is there any advantage/disadvantage in doing the conversion before the select rather than in the WHERE clause of the SELECT?
i.e. which (if either) of the following code segments would be better?
a)
SELECT rowid
FROM any_table
WHERE key_value = my_func(a_parameter);
b)
a_local_variable := my_func(a_parameter)
SELECT rowid
FROM any_table
WHERE key_value = a_local_variable
If anyone can let me know which is better, with a sensible reason why, I'd be grateful.
Thanks
Sh.
PS This is on Oracle 7.3 for SunOS if it makes a difference. Received on Thu Sep 02 1999 - 10:03:27 CDT
![]() |
![]() |