SQL Language (MOSC)

MOSC Banner

Boolean Wrapper Function used in DML where clause

edited Aug 21, 2013 3:47AM in SQL Language (MOSC) 7 commentsAnswered ✓
Hi,
I am looking for an explanation of the following behaviour.

I have a pl/sql function that checks to see if a record has expired and returns a boolean:

FUNCTION has_expired(p_record_ref IN NUMBER) RETURN BOOLEAN IS
BEGIN
  -- Processing
  RETURN (boolean result of processing)
END;

I know that I cannot use this function directly in sql as it does not understand boolean data types.

I have created a wrapper function that will return Y where the boolean function returns TRUE and N where FALSE.

I can now use this wrapper function in selecting from a table to return any records that have expired - this is working correctly:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center