diff options
Diffstat (limited to 'dbinit/procedures.sql')
-rw-r--r-- | dbinit/procedures.sql | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/dbinit/procedures.sql b/dbinit/procedures.sql index 776a7ca..51a6e10 100644 --- a/dbinit/procedures.sql +++ b/dbinit/procedures.sql @@ -27,7 +27,7 @@ drop procedure if exists spUpdatePersons; delimiter $$ create procedure spUpdatePersons(imgPath varchar(255)) begin - select concat(imgPath, regexp_replace(concat(`firstName`, " ", `middleName`, " ", `lastName`), ' *', ' '), ".jpg") from `member`; + -- select concat(imgPath, regexp_replace(concat(`firstName`, " ", `middleName`, " ", `lastName`), ' *', ' '), ".jpg") from `member`; update `member` as `A` set `A`.`photo` = ( select load_file(concat(imgPath, regexp_replace(concat(`firstName`, " ", `middleName`, " ", `lastName`), ' *', ' '), ".jpg")) as `photo` @@ -36,3 +36,16 @@ create procedure spUpdatePersons(imgPath varchar(255)) end$$ delimiter ; +drop procedure if exists spUpdateCircuits; + +delimiter $$ +create procedure spUpdateCircuits(imgPath varchar(255)) + begin + -- select concat(imgPath, regexp_replace(`name`, " ", "_"), ".png") from circuit; + update `circuit` as `A` + set `A`.`photo` = ( + select load_file(concat(imgPath, regexp_replace(`name`, " ", "_"), ".png")) as `photo` + from `circuit` as `B` + where `B`.`ID` = `A`.`ID`); + end$$ +delimiter ; |