From: | Mike Christensen <mike(at)kitchenpc(dot)com> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | PERFORM statement |
Date: | 2013-07-09 04:20:13 |
Message-ID: | CABs1bs2di4aErsq9t49tV2TLjMid9yaQeBXQeVorneZGk6QrCw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I was reading about Postgres stored procs in the FAQ:
https://wiki.postgresql.org/wiki/FAQ#Does_PostgreSQL_have_stored_procedures.3F
It claims that an alternative syntax to:
SELECT theNameOfTheFunction(arg1, arg2);
Is:
PERFORM theNameOfTheFunction(arg1, arg2);
However, when I try the following:
CREATE TABLE app_for_leave
(
sno integer NOT NULL,
eid integer,
ename varchar(20),
sd date,
ed date,
sid integer,
status boolean DEFAULT false,
CONSTRAINT pk_snoa PRIMARY KEY (sno)
);
CREATE FUNCTION MyInsert(_sno integer, _eid integer, _sd date, _ed date,
_sid integer, _status boolean)
RETURNS void AS
$BODY$
BEGIN
INSERT INTO app_for_leave(sno, eid, sd, ed, sid, status)
VALUES(_sno, _eid, _sd, _ed, _sid, _status);
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
PERFORM MyInsert(1,101,'2013-04-04','2013-04-04',2,'f' );
I get the error:
ERROR: syntax error at or near "PERFORM"
SQL state: 42601
Character: 1
Is the FAQ out of date or was this feature removed? I'm using 9.2.1.
Thanks!
Mike
From | Date | Subject | |
---|---|---|---|
Next Message | Tony Theodore | 2013-07-09 04:38:55 | Re: PERFORM statement |
Previous Message | Marcin Mańk | 2013-07-09 03:42:56 | Re: Longest Common Subsequence in Postgres - Algorithm Challenge |