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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:27:57+00:00 2026-05-27T21:27:57+00:00

I have a table variable that is being passed into a procedure. I would

  • 0

I have a table variable that is being passed into a procedure. I would like to use the values in a where clause as below, how do I do this. The first line below is declared in the package definition. The procedure below is in the package body.

type CatalogNos is table of VARCHAR2(100);
PROCEDURE GET_PART_CHARACTERISTICS (v_catalog_nos_  IN CatalogNos, 
                                    Parts_Char_Cursor out sys_refcursor) AS
BEGIN
    OPEN Parts_Char_Cursor FOR
    SELECT * FROM IFSAPP.SALES_PART_CHARACTERISTIC
    WHERE CATALOG_NO IN (select values from v_catalog_nos_);
END GET_PART_CHARACTERISTICS;
  • 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-27T21:27:58+00:00Added an answer on May 27, 2026 at 9:27 pm

    Is CatalogNos a SQL type (i.e. not declared in a package spec)? If so:

    PROCEDURE GET_PART_CHARACTERISTICS (v_catalog_nos_  IN CatalogNos, 
                                        Parts_Char_Cursor out sys_refcursor) 
    AS
    BEGIN
        OPEN Parts_Char_Cursor FOR
        SELECT * FROM IFSAPP.SALES_PART_CHARACTERISTIC
        WHERE CATALOG_NO IN (select * from table(v_catalog_nos_));
    END GET_PART_CHARACTERISTICS;
    

    “This SQL gives an error: PLS-00642: local collection types not
    allowed in SQL statements”

    So CatalogNos is not a SQL type i.e. it is a PL/SQL type declared in a package spec or body. The error message is quite clear: we cannot use PL/SQL types in SQL statements. That’s just the way it is.

    The simplest solution is to use a SQL type.

    SQL> create or replace type CatalogNos is table of VARCHAR2(100);    
      2  /
    
    Type created.
    
    SQL> 
    

    If you really don’t want to create your own type (why not?) you can use one of the Oracle built-ins. Like this:

    create or replace PROCEDURE GET_PART_CHARACTERISTICS
          (v_catalog_nos_  IN sys.dbms_debug_vc2coll,
           Parts_Char_Cursor out sys_refcursor)
    AS
    BEGIN
        OPEN Parts_Char_Cursor FOR
        SELECT * FROM IFSAPP.SALES_PART_CHARACTERISTIC
        WHERE CATALOG_NO IN (select * from table(v_catalog_nos_));
    END GET_PART_CHARACTERISTICS;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table (table variable in-fact) that holds several thousand (50k approx) rows
I have a variable being passed to my stored proc and it's a filter
I currently have a table with a repeater that is being filled with data
Here is the problem. I have a stored procedure that transforms normalized data into
I have a table that is passed via ajax and displayed. When the code
I have a table whose values are being generated dynamically with PHP, including the
I have a method insert() which inserts a list of values into a table
I have the following table variable in SQL Server 2005: DECLARE @results TABLE (id
I have a T-SQL table variable (not a table) which has an auto incrementing
Let's say I have the following simple table variable: declare @databases table ( DatabaseID

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.