Requirements for Stored Functions in SQL

There are several requirements a developer-defined PL/SQL function must meet in order to be callable from within a SQL statement:

All of the following function specifications would be rejected if used within a SQL statement:

/* SQL doesn't know about PL/SQL tables. */ TYPE string_tabtype IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER; FUNCTION temp_table RETURN string_tabtype; /* SQL doesn't know about Booleans. */ FUNCTION call_is_open (call_id_in IN call.call_id%TYPE) RETURN BOOLEAN; FUNCTION calc_sales (company_id_in IN NUMBER, use_closed_orders_in IN BOOLEAN) RETURN NUMBER;