Oracle Error Message
PLS-00643: booleans, index tables, records and cursors not allowed in SQL statements
Reason for the Error
Items of type boolean, table of foo index by binary_integer, record and static cursors cannot be used in SQL statements.
Solution
Remove expressions of these types from the SQL statement.