-
Does anyone know how I make a user-defined function "deterministic" ? I've written a complex text processing function against which I would like to create a function based index. However, I just get the error "ORA-30533: The function is not deterministic" when I try to create the index. The manual helpfully tells me that the solution is to make the function deterministic, but doesn't explain how.
-
DETERMINISTIC (in terms of FBI's) means that for a given set of inputs the function will always return the same result.
For example, TO_CHAR(date_field) always returns the same result, whereas TO_CHAR(sysdate - date_field) returns a different result depending on what day it is.
Note: You can add the DETERMINISTIC keyword to any function. See docs for details...
Jeff Hunter
-
You need to indicate that the function will always return the same value for any given set of input arguments.
Here is an example for you:
create or replace function ala_bala
return number
deterministic
as
x number;
begin
select 3.14 into x from dual;
return x;
end;
/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|