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 7626889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:23:11+00:00 2026-05-31T05:23:11+00:00

I have set up an Oracle Package with a procedure similar to the code

  • 0

I have set up an Oracle Package with a procedure similar to the code below. I had to set up a couple of globals first:

CREATE
OR REPLACE type cr_list_type AS object
(
        flag VARCHAR2(1));
CREATE
OR REPLACE type t_cr_list
IS
        TABLE OF cr_list_type;

I also define a type in the package header:

type flagTableType is table of varchar2(1) index by binary_integer;

I then created a proc as follows:

PROCEDURE get_stuff
                   (
                           o_results OUT SYS_REFCURSOR, 
                           o_files out sys_refcursor, 
                           in_list        IN flagTableType  
                   )
IS
    v_flag_list t_cr_list;
BEGIN

    v_flag_list := t_cr_list();
    v_flag_list.extend(in_list.count);

    for i in in_list.first .. in_list.last
    loop
    v_flag_list(i) := cr_states_type(in_list(i));
    end loop;

    OPEN o_results FOR
    select MyID, MyData
    FROM   MyTable
    where  MyFlag IN (SELECT flag from TABLE(v_flag_list));

  open o_files for 
    select * from MyTableFiles a
    where a.MyID in (select  MyID
                              from MyTable
                              where MyFlag in (SELECT flag from TABLE(v_flag_list)) 
                              );
EXCEPTION
WHEN NO_DATA_FOUND THEN
    NULL; -- Normal result
end get_stuff;

In the end, when i run it, i get a error occurred at recursive SQL level 1 error followed by a no statement parsed error.

I’m not using recursive queries. I know it’s in the array, since if i remove the “in (SELECT flag from TABLE(v_flag_list))” from the second cursor and go with a “= ‘X'”, then both cursors return values. If i remove the second cursor query altogether, the array works fine on the first cursor. This has me flummoxed!

  • 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-05-31T05:23:12+00:00Added an answer on May 31, 2026 at 5:23 am

    I solved my own problem. I had to cast the array for some reason into the array again.

    open o_files for 
       select * from MyTableFiles a
       where a.MyID in (select  MyID
                        from MyTable
                        where MyFlag in 
                        (SELECT flag from TABLE(cast(v_flag_list as t_cr_states)));
    

    I don’t know why that wasn’t necessary for the first cursor, but it is for the second.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the example below I have written one to_str() function and one set() procedure
I have an SSIS package set up to pull data from an Oracle database
I have a set of tables in Oracle and I would like to identify
I have a instance of Oracle Access Manager set up on Server A and
I ran the below script to set environment variables for oracle(oracle_env.sh which comes with
I have an Oracle function that returns a record set. I introduced parameters to
I have to migrate this query (simplified here) from T-SQL to ORACLE SET IDENTITY_INSERT
I have a bit of code that connects to an Oracle database, locks a
I am connecting to an oracle database using a connection pool. I have set
I have looked through the whole set of Oracle Database 11g Release 2 (11.2)

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.