MANEJO CURSOR MYSQL


/ Published in: MySQL
Save to your folder(s)

Esquema basico manejo cursores en MYSQL


Copy this code and paste it in your HTML
  1. /* Incluir aqui Todas las variables del cursor*/
  2.  
  3. DECLARE docs CURSOR FOR /* añadir aqui la sentencia SQL */ ;
  4.  
  5. DECLARE CONTINUE HANDLER FOR NOT FOUND SET idone = 1;
  6.  
  7. OPEN docs;
  8. FETCH docs INTO /* asignacion valores cursor a variables */ ;
  9. IF NOT idone THEN
  10. /* INCLUIR AQUI TODO EL CODIGO PARA CADA REGISTRO DEL CURSOR */
  11. UNTIL idone END REPEAT;
  12. CLOSE docs;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.