Jump to content

Frostwind

Leecher
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Frostwind

  1. Debo crear un cursor que haga lo mismo que un "Distinct", es decir que discrimine todos los datos que esten repetidos. El siguiente codigo es lo que tengo, el problema es que me muestra 19 valores de 30, y no se que pasa con el resto. Espero haber sido claro y que alguien pueda ayudarme con mi problema. Gracias :D Set Serveroutput On Declare Cursor C_Contador Is Select Object_Type FROM all_objects order by object_type; V_Old Objetos.Object_Type%Type; v_new objetos.Object_Type%Type; V_Count Number(8); v_flag number(8); Begin Open C_Contador; V_Flag:=0; v_count:=0; Loop Fetch C_Contador Into V_Old; If V_Flag=1 Then Fetch C_Contador Into V_New; If V_Old<>V_New Then V_Count:=V_Count+1; dbms_output.put_line(v_count||' '|| V_new); End If; End If; V_Flag:=1; Exit When C_Contador% Notfound; End Loop; Close C_Contador; End;
×
×
  • Create New...