Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7778463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:24:13+00:00 2026-06-01T18:24:13+00:00

I am getting a ORA-06532 error in my pl/sql procedure. It has to do

  • 0

I am getting a ORA-06532 error in my pl/sql procedure. It has to do with my array, and it seems to be happening on the line that starts: “term_1 := …”. The query that selects into gets 7 records, so it should be the same amount as what I am calling for. I am a little new to the SQL array thing, so I may have missed something obvious. Any help is appreciated, thanks.

DECLARE

listOfTerms      VC50_ARRAY;
term_1           varchar2(30);
term_2           varchar2(30);
term_3           varchar2(30);
term_4           varchar2(30);
term_5           varchar2(30);
term_6           varchar2(30);
term_7           varchar2(30);

BEGIN

SELECT apl.awdp_acad_terms 
BULK COLLECT INTO listOfTerms
FROM fa_years fay 
   JOIN award_periods_ls apl
     ON apl.award_periods_id = fay.award_periods_id 
WHERE (SELECT b.awdp_fa_year as faYear 
      FROM award_periods_ls a 
           JOIN coll18_test.fa_years b ON a.award_periods_id = b.award_periods_id 
     WHERE awdp_acad_terms = v_ug_term) = fay.awdp_fa_year
ORDER BY apl.awdp_acad_terms DESC;

term_1   := listOFTerms(1);     
term_2   := listOFTerms(2);             
term_3   := listOFTerms(3);
term_4   := listOFTerms(4);             
term_5   := listOFTerms(5);             
term_6   := listOFTerms(6);             
term_7   := listOFTerms(7);   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:24:14+00:00Added an answer on June 1, 2026 at 6:24 pm

    I think you’re over-complicating this. You code is equivalent to:

    DECLARE
    
       -- Declare the cursor explicitly.
       cursor c_my_cursor is
         SELECT apl.awdp_acad_terms 
           FROM fa_years fay 
           JOIN award_periods_ls apl
             ON apl.award_periods_id = fay.award_periods_id 
          WHERE ( SELECT b.awdp_fa_year as faYear 
                    FROM award_periods_ls a 
                    JOIN coll18_test.fa_years b 
                      ON a.award_periods_id = b.award_periods_id 
                   WHERE awdp_acad_terms = v_ug_term ) = fay.awdp_fa_year
          ORDER BY apl.awdp_acad_terms DESC;
    
       -- Create a-user defined type that is the same as a single row in the cursor.
       type t__listOfTerms is table of c_my_cursor%rowtype index by binary_integer;
       -- Initialise a variable that is of data-type t__listofterms.
       t_listofterms t__listofterms;
    
    BEGIN
    
       open c_my_cursor;
       fetch c_my_cursor bulk collect into t_listofterms;
       close c_my_cursor;
    
    END;
    

    You can then reference the items in your type by their index values so term_1 is the same as t_listofterms(1). There’s no need create an additional variable with the same value; you can reference it in the same way so length(term1) and length(t_listofterms(1)) are also the same.

    There’s a lot of stuff out there about array processing but PSOUG is helpful as is the documentation.


    Judging by your comment you may be referencing the collection explicitly, i.e. something := t_listofterms(7). This assumes that there is a specific number of rows. Bulk collect fills a collection from 1 to n, where n is the number of rows returned by the query. It’s often better to loop through this if you want to do something with it rather than explicit referencing. Something like,

    for i in t_listofterms.first .. t_listofterms.last loop
    
        do_something;
    
    end loop;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the 'SQL Error: ORA-01733: virtual column not allowed here' Here is
I have problem executing below stored procedure. I am getting error of ORA-00932: inconsistent
I'm getting the following error in on Oracle SQL Developer: Error starting at line
Why do I keep getting this error: javax.servlet.ServletException: java.sql.SQLException: [Oracle][ODBC][Ora]ORA-00904: PURCHASE_PRICE: invalid identifier As
I'm getting this error: ORA-06502: PL/SQL: numeric or value error: character to number conversion
I have a query that I am currently getting the ORA-01427: single-row subquery returns
I'm having trouble getting this query to run. I keep getting an ORA-00933 error.
I am getting the error ORA-00936: missing expression on the following SQL statement: SELECT
I'm getting an error message of ORA-00936: missing expression at the very start of
I am continuously getting Error Code The ORA-01033: ORACLE initialization or shutdown in progress

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.