Friday 25 May 2012

What are the restrictions on functions that are called within SQL statements? | PL SQL

 The functions that are called within SQL statements have the following restrictions:
a.    They must be stored in a database.
b.    They cannot modify any database table.
c.    They can only take the IN parameter modes. The OUT and IN OUT parameter modes are not allowed in a function.
d.    They can only use valid SQL datatypes, such as NUMBER, VARCHAR2, and DATE. However, they cannot use PL/SQL datatypes, such as BOOLEAN, RECORD, and TYPE.
e.    The return type of a function should be of SQL datatype.
f.    They cannot have the COMMIT and ROLLBACK statements.
h.   They cannot have the ALTER SESSION and ALTER SYSTEM commands.