Quantcast
Viewing all articles
Browse latest Browse all 8968

Re: VAR_OUT inside cursor

Hi Sergey,

 

If you want to retain the cursor(though you could try the same with JOINS), you can consider using arrays.

 

DECLARECURSOR c_cursor1 FOR

                           SELECT"SUPNUM"FROM"_SYS_BIC"."Stocks/STOCKS"

WHERE"SUPNUM"IN ('00000028345', '00000039053')

                           GROUPBY"SUPNUM";

 

DECLARE AR_SUPNUM   VARCHAR(10) ARRAY;


FOR cur_row as c_cursor1 DO

    

         V_COUNT := V_COUNT + 1;

 

     Select"SUPNUM"FROM"_SYS_BIC"."Stocks/STOCKS" INTO V_SUPNUM

         WHERE"SUPNUM" = cur_row.SUPNUM GROUPBY"SUPNUM";

 

        AR_SUPNUM[:V_COUNT] =  :V_SUPNUM;

 

ENDFOR


VAR_OUT = UNNEST(:AR_SUPNUM)




Nehal.



Viewing all articles
Browse latest Browse all 8968


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>