Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Collection Help
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ExecMan  
View profile  
 More options Mar 14 2012, 5:26 pm
Newsgroups: comp.databases.oracle.server
From: ExecMan <artme...@yahoo.com>
Date: Wed, 14 Mar 2012 14:26:02 -0700 (PDT)
Local: Wed, Mar 14 2012 5:26 pm
Subject: Collection Help
Hi,

I have a multi-level collection, indexed by VARCHAR2.  After I fill it
I try and traverse it and print out data and I'm getting an error.
Can anyone see maybe what I am doing wrong??  Here is my code.

The actual error is referring to the first FOR index1 loop.

Thanks in advance!

TYPE order_rec IS RECORD (
  order_date         DATE,
  order_cnt          NUMBER,
  order_amt          NUMBER);

TYPE order_tab IS TABLE OF order_rec INDEX BY VARCHAR2(30);

TYPE registration_rec IS RECORD (
  date_registered      DATE,
  total_registered     NUMBER,
  order_data           ORDER_TAB);

TYPE registration_tab IS TABLE OF registration_rec INDEX BY
VARCHAR2(30);

v_order_tab       REGISTRATION_TAB;

BEGIN
.
.

  FOR index1 IN v_order_tab.FIRST .. v_order_tab.LAST LOOP
    v_string1 := TO_CHAR(v_order_tab(index1).date_registered,'Month
YYYY') || ',' || v_order_tab(index1).total_registered;
    v_string2 := NULL;
    FOR index2 IN v_order_tab(index1).order_data.FIRST ..
v_order_tab(index1).order_data.LAST LOOP
      v_string2 := v_string2 ||
TO_CHAR(v_order_tab(index1).order_data(index2).order_date,'Month') ||
',' ||

v_order_tab(index1).order_data(index2).order_cnt || ',' ||

v_order_tab(index1).order_data(index2).order_amt;
    END LOOP;

    UTL_FILE.PUT_LINE(v_file_id,v_string1 || ',' || v_string2);
  END LOOP;

ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number
conversion error
ORA-06512: at line 80


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.