Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.26 KB | None | 0 0
  1. CREATE OR REPLACE FUNCTION migration ()
  2. RETURNS void
  3. AS'
  4. declare
  5. total secretario%RowType;
  6. BEGIN
  7. FOR total IN SELECT * FROM secretario
  8. loop
  9. insert into secretario_escola values(total.id, total.escola_id);
  10. end loop;
  11. END'
  12. LANGUAGE plpgsql;
  13.  
  14. SELECT migration();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement