On Tue, April 21, 2009 05:13, Sphenix wrote:
>
> ______________________________________
>
> CREATE PROCEDURE UPL_JC IS CURSOR C1 IS
>
>  SELECT EMPLID
>  ,P_UPL_START
>  ,P_UPL_TAKE
>   FROM PS_P_UPL_CALC_L_JC;
>
>   V_EMPLID VARCHAR(10);
>   V_P_UPL_START DATE;
>   V_P_UPL_TAKE NUMBER;
>   V_UPL_DATE DATE;
>
>   BEGIN OPEN C1;
>   LOOP
>
>     FETCH C1 INTO V_EMPLID
>     ,V_P_UPL_START
>   ,V_P_UPL_TAKE;
>
>   BEGIN WHILE V_P_UPL_TAKE > 0
>
>   LOOP
>
>       INSERT INTO PS_P_UPL_START_JC(EMPLID
>       , P_UPL_START)
>         VALUES(V_EMPLID
>         , V_UPL_DATE);
>
>         V_UPL_DATE:= V_P_UPL_START+V_P_UPL_TAKE;
>         V_P_UPL_TAKE:= V_P_UPL_TAKE - 1;
>
>   END LOOP;
>
>   COMMIT;
>   END;
>   END LOOP;
>   CLOSE C1;
>   END;
>
> *Data in PS_P_UPL_CALC_L_JC*
> ______________________________________________
> EMPLID        P_UPL_START             P_UPL_TAKE
> 00998 01.01.2008 00:00:00     59
> 07243 22.10.2008 00:00:00     1
> 07661 17.03.2008 00:00:00     198
> ______________________________________________
> Select * from PS_P_UPL_CALC_L_JC
> ______________________________________________
>
>
>
> I'm having infinite loop on this PL/SQL, suspect is cause right here
> "  BEGIN OPEN C1;
>   LOOP "
>
>
> >
>
Anytime you have a "loop ... end loop;" with no way to break out of it you
guarantee an infinite loop unless you hit an exception along the way.

Everything else aside ... why don't you just use a cursor for loop to
drive it? It looks like that is what you are attempting to do without
actually doing it.

Just thinking out loud

Rob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to