tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
vw_file_update()
Parameters
Name
Type
Mode
IN
Definition
BEGIN NEW._url = replace(NEW._url, '\', '/'); UPDATE tww_od.file SET classname = NEW.classname, identifier = NEW.identifier, kind = NEW.kind, object = NEW.object, path_relative = SUBSTRING(NEW._url, LENGTH(dm.path)+1, LENGTH(NEW._url)), fk_dataowner = NEW.dataowner, fk_provider = NEW.provider, fk_data_media = dm.id, remark = NEW.remark FROM ( SELECT obj_id as id, path FROM tww_od.data_media WHERE path = SUBSTRING(NEW._url FROM 1 FOR LENGTH(path)) ORDER BY LENGTH(path) DESC LIMIT 1) dm WHERE obj_id = OLD.obj_id; RETURN NEW; END;