feat: added addPerson procedure
This commit is contained in:
parent
3a87573fd9
commit
7744a4c31e
1 changed files with 50 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue