Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. delimiter //
  2. CREATE PROCEDURE procedure1()
  3. begin
  4. DECLARE str char(64);
  5. DECLARE cur CURSOR for select TABLE_NAME FROM information_schema.columns WHERE column_name = 'mycolum1' AND TABLE_SCHEMA='mydb';
  6. OPEN cur;
  7. read_loop: loop
  8. FETCH cur INTO str;
  9. CREATE TRIGGER str BEFORE INSERT ON str FOR EACH ROW SET NEW.mycolum1=sha1(NEW.mycolum1);
  10. END LOOP;
  11. CLOSE cur;
  12. end //
Advertisement
RAW Paste Data Copied
Advertisement