Hi all !
I want an SQL function a rough structure below-
CREATE FUNCTION ins_both(int,int,int,int) RETURNS boolean AS '
BEGIN
INSERT INTO inv2 values($2,$3,$4);
INSERT INTO inv1 values($1,$2,$3);
COMMIT
' LANGUAGE SQL;
but we cannot include Begin and commit in an SQL function
so i came out with the following which is not right
Create function insboth(int,int,int,int) RETURNS void AS $$
START TRANSACTION;
INSERT INTO inv2 values($2,$3,$4);
INSERT INTO inv1 values($1,$2,$3);
END TRANSACTION;
$$LANGUAGE SQL;
In short what i look for, i commit only after inserting these 2 tuples and
later it fires my trigger etc. If there is any other possible way please let
me know.
Thanks
Cheers
Prasad.