Advertisement

02.14.2008 at 01:26AM PST, ID: 23162375
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Assosiative Arrays Problem

Hi,

I have one associative array which I need to take the data from and build up another array.

Existing code:
Build up first array:

for r_get_clauses in c_get_clauses(p_request_id,p_prod_line_id) loop
   
for r_get_obj in c_get_obj(p_request_id) loop
     
  if (r_get_obj.object_no = r_get_clauses.object_no) OR (r_get_clauses.object_no is null) then
   array_row := array_row + 1;
         
  item_clause_table(array_row).item :=  trim(r_get_obj.rnum);
  item_clause_table(array_row).clause :=  trim(r_get_clauses.CLAUSE_ID);

   end if;
   end loop;
   end loop;

This results in the following table
Item  Clause
1      16
2      16
3      16
2      56
1     150

I need to take the data by looping through the first array and populate a second array whilst transforming the data to this:

Item                   Clause
Item 1 & 2 & 3    16
Item 2                 56
Item 1                 150

As you can see the code should check all item which matches a clause, and write them in a single row as shown above.

I have started on the second array, but got stuck with the NEXT.PRIOR methods.

This is what I have so far:
 --read item_clause_table
     FOR i IN item_clause_table.FIRST .. item_clause_table.LAST
    LOOP
   
        if (item_clause_table(i).clause = prev_clause) OR (prev_clause is null) then
        array_row_out := array_row_out + 1;
       
          if prev_clause is null then
            v_item_out := 'Item ' || item_clause_table(i).item;
            else
            v_item_out := v_item_out || ' & ' || item_clause_table(i).item;
          end if;
         
         if item_clause_table.NEXT(item_clause_table(i).clause) <> item_clause_table(i).clause then

         item_clause_table_out(array_row_new).item :=  trim(to_char((v_item_out)));
         item_clause_table_out(array_row_new).clause := prev_clause;
       
         end if;
         
        else

        array_row_new := array_row_new + 1;
        item_clause_table_out(array_row_new).item :=  trim(to_char((v_item_out)));
        item_clause_table_out(array_row_new).clause := item_clause_table(i).clause;
       
        end if;

Any help will be appreciated.
Start your free trial to view this solution
Question Stats
Zone: Database
Question Asked By: barnarp
Solution Provided By: sdstuber
Participating Experts: 1
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
02.17.2008 at 09:04PM PST, ID: 20917694

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.18.2008 at 05:16AM PST, ID: 20919547

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.18.2008 at 05:16AM PST, ID: 20919556

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.18.2008 at 06:03AM PST, ID: 20919950

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628