feat: added addPerson procedure

This commit is contained in:
Timo Ley 2023-06-24 21:37:52 +02:00
parent 3a87573fd9
commit 7744a4c31e

View file

@ -43,6 +43,56 @@ BEGIN
return ids;
END;
CREATE OR REPLACE PROCEDURE addPerson(
pFirstName IN VARCHAR,
pLastName IN VARCHAR,
pAge IN NUMBER,
pStreet IN VARCHAR,
pHouseNumber IN NUMBER,
pPostalCode IN NUMBER,
pCity IN VARCHAR,
pCountry IN VARCHAR
)
IS
BEGIN
INSERT INTO ADDRESS
(
addressId,
street,
houseNumber,
postalCode,
city,
country
)
VALUES
(
ADDRESS_SEQ.nextval,
pStreet,
pHouseNumber,
pPostalCode,
pCity,
pCountry
);
INSERT INTO PERSON
(
personId,
name,
lastName,
age,
addressId
)
VALUES
(
PERSON_SEQ.nextval,
pFirstName,
pLastName,
pAge,
ADDRESS_SEQ.currval
);
COMMIT;
END;
CREATE OR REPLACE PROCEDURE rooms(clientz IN NUMBER, months IN NUMBER)
IS