Mega Code Archive

 
Categories / PostgreSQL / Store Procedure Function
 

Real number parameter

postgres=# postgres=# postgres=# postgres=# CREATE FUNCTION sales_tax(subtotal real) RETURNS real AS $$ postgres$# BEGIN postgres$#    RETURN subtotal * 0.06; postgres$# END; postgres$# $$ LANGUAGE plpgsql; postgres=# postgres=# postgres=# select sales_tax(100);    REATE  sales_tax -----------          6 (1 row) postgres=# postgres=# drop function sales_tax( real); DROP FUNCTION postgres=# postgres=#