DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Havin problems with package body!

Threaded View

  1. #6
    Join Date
    Jun 2005
    Location
    London, UK
    Posts
    159
    No, but you can refer to elements of an array by subscript. Perhaps instead of 50 rate attributes you could have 1 array with 50 elements (one for 'AK', one for 'AL' and so on). For example,
    Code:
    TYPE rate_pct_tt IS TABLE OF cycle_rates.rate_pct%TYPE INDEX BY VARCHAR2(2);
    
    TYPE rate_rec IS RECORD
    ( id cycle_rates.id%TYPE
    , cycle cycle_rates.cycle%TYPE
    , scac cycle_rates.scac%TYPE
    , gbloc cycle_rates.gbloc%TYPE
    , code cycle_rates.code%TYPE
    , rates rate_pct_tt );
    
    v_rate  rate_rec;
    
    ...
    
    v_rate.rates('AK') := 12.34;
    Now you can loop around that array using FIRST, NEXT, LAST etc as normal.
    Last edited by WilliamR; 02-21-2006 at 02:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width