- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
CREATE FUNCTION "insert_payment" (integer) RETURNS integer AS '
DECLARE
l_payment integer;
BEGIN
INSERT INTO payments (client,type_,pdate,number_)
VALUES ($1,4,current_date,nextval_(''payments_number_1_seq''));
SELECT INTO l_payment last_value FROM payments_id_seq;
RETURN l_payment;
END;' LANGUAGE 'plpgsql';