I have the following table:
CREATE TABLE Emprestimo (
id int PRIMARY KEY,
dataRetirada date DEFAULT current_date,
dataPrevistaDevolucao date DEFAULT current_date + 7,
dataDevolucao date,
codigoUsuario int,
codigoExemplar int,
FOREIGN KEY(CodigoUsuario) REFERENCES Usuario (CodigoUsuario),
FOREIGN KEY(CodigoExemplar) REFERENCES Exemplares (CodigoExemplar)
);
From this table, you need to do a procedure that extends the return period (without exceeding the maximum number of days of the month) by 5 days, passing an ID pro procedure, at first it would be good to use the procedure to call a function, however I spent very little time on procedure;
Note: I'm developing within Oracle SQL developer
What I've achieved so far:
CREATE OR REPLACE PROCEDURE P_Emprestimo (idE INT)IS BEGIN update Emprestimo set dataPrevistaDevolucao = dataPrevistaDevoluçao + 7 where id = idE; END;
And it returns me:
Error (3,2): PL / SQL: SQL Statement ignored Error (4.30): PL / SQL: ORA-00904: "RETURNABILITY": identifier Invalid