daily pastebin goal
91%
SHARE
TWEET

Untitled

a guest Aug 16th, 2018 54 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. DECLARE R CURSOR FOR SELECT C.CODIGO FROM TABELA1;  
  2. DECLARE CONTINUE HANDLER FOR NOT FOUND SET done2 = TRUE;
  3. DECLARE aulas CURSOR FOR    SELECT DISTINCT a.codigo FROM TABELA2;  
  4. DECLARE CONTINUE HANDLER FOR NOT FOUND SET done1 = TRUE;
  5.    
  6. OPEN R; -- VAMOS DAR UM LOOP NOS COLABORADORES
  7.     loop0: LOOP
  8.          FETCH R INTO v_codfun;
  9.             IF done2 THEN
  10.                LEAVE loop0;
  11.             END IF;
  12.  
  13.             BLOCO2: BEGIN
  14.  
  15.               OPEN aulas; -- VAMOS DAR UM LOOP NAS AULAS        
  16.                  loop1: LOOP    
  17.                     FETCH aulas INTO v_codaula;  
  18.                     IF done1 THEN
  19.                         LEAVE loop1;
  20.                     END IF;
  21.                         ***
  22.                   END LOOP loop1;  
  23.                 CLOSE aulas;        
  24.  
  25.             END BLOCO2;
  26.     END LOOP ;      
  27. CLOSE R;
  28. SELECT * FROM temp1;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top