What is a deterministic function?

What is a deterministic function? What are the advantages if we define a function as a determnisitic?

Thanks in advance Regards


more ▼

asked Nov 26, 2009 at 05:32 PM in Default

avatar image

606 54 62 66

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

A deterministic function gives always the same result to given parameters. The result of a deterministic function depends only from the input. It can have more than one parameter.

Samples of deterministic functions: length, to_upper, trunc, substr

Oracle uses deterministic functions building function based indexes. Be deterministic is necessary because oracle stores the function result into a normal index. At query time the optimizer calls the function again for query parameters but not for all table values.

more ▼

answered Nov 27, 2009 at 05:45 AM

avatar image

846 1 2 6

HI.. Can we define a procedure also deterministic?

Nov 27, 2009 at 02:22 PM BI DWH BALA

No. Only plsql functions can be defined to be deterministic. Procedures cannot be used in places where functions should be deterministic.

Nov 30, 2009 at 06:22 AM Christian13467
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 26, 2009 at 05:32 PM

Seen: 2143 times

Last Updated: Dec 15, 2009 at 08:47 PM

Copyright 2018 Redgate Software. Privacy Policy