A PL/SQL function in Oracle can be tagged with a DETERMINISTIC clause, to indicate that the function will always produce the same output for a given input and will have no side effects.

A little elaboration is in order here.

1. …will always produces the same output for a given input

Let’s see this with an example: a function get_primary_phone takes as input customer_id and returns the customer’s primary phone. Internally, the function executes SQL on a customer contact table, ranks and filters the result to get the customer’s primary phone number.

[click to continue…]

{ 2 comments }

It is quite normal for Oracle database objects to become INVALID, especially when a dependency chain is broken. This article takes a closer look at:

  • typical reasons why Oracle objects become INVALID
  • how to identify INVALID objects in Oracle
  • how to convert INVALID objects to VALID

[click to continue…]

{ 0 comments }