Guest User

Untitled

a guest
Jan 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. BEGIN
  2. SET @cont = 0;
  3. REPEAT
  4. SET @sqlstring = "UPDATE import2016 SET coluna4 = (SELECT coluna4 FROM import2016 AS a WHERE a.coluna2 ='' and a.coluna4 like'%/%' LIMIT ?,01) WHERE id = (SELECT id+7 FROM import2016 AS a WHERE a.coluna2 ='' and a.coluna4 like'%/%' LIMIT ?,01);";
  5. PREPARE stmt FROM @sqlstring ;
  6. EXECUTE stmt USING @cont,@cont;
  7. DEALLOCATE PREPARE stmt;
  8. SET @cont = @cont +1;
  9. UNTIL @cont = 256
  10. END REPEAT;
  11. END
  12.  
  13.  
  14. /* Erro SQL (1093): You can't specify target table 'import2016' for update in FROM clause */
Add Comment
Please, Sign In to add comment