Return 'double' from function : Function Return « Store Procedure Function « PostgreSQL






Return 'double' from function

postgres=# CREATE FUNCTION "double_price" (double precision) RETURNS double precision AS '
postgres'#   DECLARE
postgres'#   BEGIN
postgres'#     return $1 * 2;
postgres'#   END;
postgres'# ' LANGUAGE 'plpgsql';
CREATE FUNCTION
postgres=#
postgres=# select double_price(10);
 double_price
--------------
           20
(1 row)

postgres=#

           
       








Related examples in the same category

1.Define function to add two parameters together
2.Return entire row
3.Using the result set returned from the function
4.Returning a concatenated string
5.A SQL function that returns a book title based on the ID number passed to the function
6.Return a table from a function