Re: Collection Help

From: onedbguru <onedbguru_at_yahoo.com>
Date: Wed, 14 Mar 2012 18:16:36 -0700 (PDT)
Message-ID: <19028118.2786.1331774196831.JavaMail.geo-discussion-forums_at_vbbfw10>



On Wednesday, March 14, 2012 6:33:33 PM UTC-4, dombrooks wrote:
> The FOR LOOP with FIRST and LAST a) only works for index-by integers and b) is not great for sparse collections.
>
> A WHILE loop that iterates through the collection using .NEXT suits all scenarios.
>
> e.g. something like:
>
> DECLARE
> ...
> idx VARCHAR2(30);
> ...
> BEGIN
> idx := v_order_tab.FIRST;
> WHILE (idx IS NOT NULL)
> LOOP
> ...
> idx := v_order_tab.NEXT(idx);
> END LOOP;
> ...
> END;
Dom - WRONG!!

Actual the error is pretty self explanatory The OP is trying to concatenate a number to a string (VARCHAR2). This is NOT java or PHP.

this is the problem:
...|| ',' || v_order_tab(index1).total_registered; total_registered is defined as a NUMBER data type. Received on Wed Mar 14 2012 - 20:16:36 CDT

Original text of this message