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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:02:26+00:00 2026-06-05T14:02:26+00:00

I have an arraylist of Strings and a string which is the csv format

  • 0

I have an arraylist of Strings and a string which is the csv format of this list.
I want to write an sql query which refines the result on this list basis.
So, I want something like —

select * from table_name where name in (`ArrayList<String> values` or `csv format string`).

I believe that something like procedure, functions etc. can be made to solve the purpose.
I just want to know how can i achieve this.
Thanks

  • 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-05T14:02:27+00:00Added an answer on June 5, 2026 at 2:02 pm

    It’s unclear what exactly you mean by ArrayList; are you talking about a C#/Java/whatever type here (since Oracle PL/SQL doesn’t have Generics)?

    Anyway, here is one way to convert a comma-separated list in PL/SQL into a PL/SQL table und use it for an IN search:

    (see AskTom)

    CREATE OR REPLACE TYPE STRINGLISTT as table of varchar2(4000);
    
    create or replace function in_list(p_string    in varchar2,
                           p_delimiter in varchar2) return StringListT is
            l_string long default p_string || p_delimiter;
            l_data   StringListT := StringListT();
            n        number;
          begin
            loop
              exit when l_string is null;
              n := instr(l_string,
                         p_delimiter);
              l_data.extend;
              l_data(l_data.count) := ltrim(rtrim(substr(l_string,
                                                         1,
                                                         n - 1)));
              l_string := substr(l_string,
                                 n + 1);
            end loop;      
            return l_data;      
          end;
    

    Usage:

      select * from my_tab t where t.name in 
       (select * from table(in_list('A,B', ',')));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ArrayList of strings, and I want to randomly change a string's
E.G. to create an ArrayList of Strings we have to do something like List<String>
I have arraylist myorderdata . I want to retrieve this arraylist to one String
I have java API which return this type: ArrayList[ArrayList[String]] = Foo.someJavaMethod() In scala program,
I have static ArrayList<Batch> . i want to remove which object contain productcode This
i have an arraylist of strings in my servlet which im passing forwarding using
I have an ArrayList that has a nested ArrayList of Strings and I want
I have an ArrayList of HashMap like this: ArrayList<HashMap<String, String>> playListSongs = new ArrayList<HashMap<String,
I have the following ArrayList ArrayList<HashMap<String, String>> list; HashMap<String, String> map; with the following
I have a string which contains XML. I want to create an XMLdocument from

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.