0
FOLDER(CodFO,name,path,dim,ContainerFolder)
FILE(CodFI,name,CodFO,path,dateC,dateE,dim)

After a file is inserted into the FILE class , its path field gets updated after the instert in a way that it has to be the concatenation of the path of the container folder and of the name of the file itself.

CREATE TRIGGER CheckPath
AFTER INSERT  ON file OF path
FOR EACH ROW
BEGIN

    SELECT CodFI , CodFO
    FROM Folder as FO JOIN File as FI ON FO.CodFO=FI.CodFO
    GROUP BY CodFI;
    
    INSERT INTO FILE 
    VALUES (New.CodFI,New.name,New.path,New.dateC,New.dateE,New.dim)
END;
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.