1 Answers

Anonymous User
Anonymous User

That is the SQL Functions are a database object in SQL Server. Mainly, it is a set of SQL statements that accept only input parameters, perform actions and return the result. A function can return only a single value or a table. You can’t use a function to Insert, Update, Delete records in the database tables.

Example:- 

CREATE OR REPLACE FUNCTION totalCustomers 

RETURN number IS
   total number(2) := 0;
BEGIN
   SELECT count(*) into total
   FROM customers;

   RETURN total;
END; 

Answer