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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:32:07+00:00 2026-06-06T20:32:07+00:00

There is a problem executing this block of code while passing the parameter. Parameter

  • 0

There is a problem executing this block of code while passing the parameter. Parameter rf is a list of variables to be input into the WHERE clause. The number of variables to be input is not static.

create or replace
procedure test_pl(rf in varchar2)
IS 
counter number;

BEGIN
  select count(*) into counter from test_pl_imp where column_name in (rf);
  dbms_output.put_line(counter);
END;

The execution code is as follows:

declare 
inparam varchar2(20) := 'xyz,ran,dom';
begin
goku.test_pl(inparam);
end;
/

I want the WHERE condition to be executed like :

where column_name in ('xyz','ran','dom');

But it gets executed considering xyz,ran,dom as a string itself.

Is there any way to achieve it?

  • 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-06T20:32:09+00:00Added an answer on June 6, 2026 at 8:32 pm

    You can either explode the string out or the simplest way would be to use INSTR.

    rf := ',' || rf || ',';
    
    SELECT
        COUNT(*)
    INTO
        counter
    FROM
        test_pl_imp
    WHERE
        INSTR(rf, ',' || column_name || ',') > 0;
    

    If you have the option to redesign this slightly, I think it would be a cleaner design to take an array of strings and you casting it to a TABLE so that you can join to test_pl_imp.

    This could be done as follows:

    DECLARE
        l_array   goku.t_type := goku.t_type();
    BEGIN
        l_array.extend(3);
        l_array(1) := 'xzy';
        l_array(2) := 'abc';
        l_array(2) := '123';
    
        goku.test_pl(l_array);
    END;
    

    And then your package spec would including the following since you want the types and procedures public for the above call:

    CREATE OR REPLACE PACKAGE goku
        TYPE r_type IS RECORD (
            search_term    VARCHAR2 (30)
        );
    
        TYPE t_type IS TABLE OF r_type;
    
        PROCEDURE test_pl(l_array IN t_type);
    END goku;
    

    And your package body would be something like the following:

    CREATE OR REPLACE PACKAGE BODY goku
        PROCEDURE test_pl(l_array IN t_type) IS
            v_counter NUMBER;
        BEGIN
    
            SELECT
                COUNT(tpi.*)
            INTO
                v_counter
            FROM
                test_pl_imp tpi
                , TABLE( CAST(l_array as r_type)) la
            WHERE
                tpi.column_name = la.search_term;
    
            DBMS_OUTPUT.PUT_LINE('Count :' || v_counter);
        END;
    END goku;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any problem with my code ? std::vector<int[2]> weights; int weight[2] = {1,2};
Is there a problem with this type of implementation to wait for a batch
Is there significant problem, if I write the code for embedded linux system using
Consider this problem: There's a square grid defined, each tile being either passable (1)
what's the problem there, I have uploaded this video to server, but now its
I have an R code block that generates an image (see below). Executing the
I'm having difficultly figuring out how to write this block of code... function myFunction(x,y,z)
Problem There are data gaps that need to be filled. Would like to avoid
Problem: There are a lot of different databases, which is populated by many different
is there any problem to install different oracle 11g versions. I mean if I

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.