CREATE TABLE app_for_leave
(
sno integer NOT NULL,
eid integer,
ename varchar(20),
sd date,
ed date,
sid integer,
status boolean DEFAULT false,
CONST
Starting from PostgreSQL 11 you could create stored procedures and invoke them using CALL:
CREATE PROCEDURE MyInsert(_sno integer, _eid integer, _sd date,
_ed date, _sid integer, _status boolean)
LANGUAGE SQL
AS $$
INSERT INTO app_for_leave(sno, eid, sd, ed, sid, status)
VALUES(_sno, _eid, _sd, _ed, _sid, _status);
$$;
CALL MyInsert(1,101,'2013-04-04','2013-04-04',2,'f' );
Plus it allows to handle transaction
SQL Stored Procedures
PostgreSQL 11 introduces SQL stored procedures that allow users to use embedded transactions (i.e. BEGIN, COMMIT/ROLLBACK) within a procedure. Procedures can be created using the CREATE PROCEDURE command and executed using the CALL command.