Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROCEDURY SKŁADOWE CREATE OR REPLACE PROCEDURE dodaj_nieruchomosc_cala(integer, numeric, integer, varchar, boolean, varchar, integer, integer, varchar, numeric, numeric, integer, integer, boolean, text[])
- LANGUAGE plpgsql
- AS
- $$
- DECLARE e integer;
- BEGIN
- -- dodanie nieruchomosc
- insert into nieruchomosc (idWlasciciel, metraz, pietro, opis, dostepnosc) values ($1, $2, $3, $4, $5);
- e := (SELECT max(n.id) from nieruchomosc n);
- -- dodanie adresnieruchomosc
- insert into adresnieruchomosc (id, ulica, nrMieszkania, nrDomu, miejscowosc) values (e, $6, $7, $8, $9);
- -- dodanie koszt
- insert into koszt (id, cena, cenaMinimalna) values (e, $10, $11);
- -- dodanie pomieszczenia
- insert into pomieszczenia (id, iloscPokoi, iloscLazienek, jestBalkon) values (e, $12, $13, $14);
- -- dodanie wyposazenie
- insert into wyposazenie (id, asortyment) values (e, $15);
- COMMIT;
- END;
- $$;
- call dodaj_nieruchomosc_cala(10, 80.5, 5, 'zwykle m4', true, 'Zmyslowa', 14, 9, 'Wloclawek', 800.00, 700.00, 4, 1, true, ARRAY [ 'lodowka', 'pralka', 'suszarka', 'kuchenka', 'telewizor', 'komputer' ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement