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

  • Home
  • SEARCH
  • 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 199753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:03:03+00:00 2026-05-11T17:03:03+00:00

I’d like to pass a set of record identifiers into an Oracle procedure, using

  • 0

I’d like to pass a set of record identifiers into an Oracle procedure, using a comma-separated string. I want to place this into a temp table and then join off that in further processing. How would I go about this?

Better approaches than CSV’s would be great to hear about too. I’m using ODP.Net for data access.

  • 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-11T17:03:03+00:00Added an answer on May 11, 2026 at 5:03 pm

    I don’t know anything about ODP.net, but why concatenate all the record identifiers into a CSV string?

    A better approach may be to create an array parameter in your procedure and pass an array of identifiers in. I guess it depends on where you get your list of identifiers from and whether they start off as an array or CSV string?

    Here is an example of using an array type and joining that to your query without using a temporary table (you could do something similar with an IN list but its harder to bind):

    create or replace type my_test_type as object (id integer);
    
    create or replace type my_test_type_a as table of my_test_type;
    
    create or replace procedure my_test_proc(i_ids in my_test_type_a)
    is
    begin
    
     for row in (
       select a.l from
       (
         select level l from dual connect by level <= 10
       ) a, table(i_ids) b
       where a.l = b.id 
     ) loop
       dbms_output.put_line(row.l);
     end loop;
    end;
    /
    

    Note that the query in the test procedure used the ‘table’ function to turn the passed in array into a table in the query you can actually join other real tables to.

    Also not that the subquery ‘a’, uses a trick to create a fake test table that contains 10 rows with values from 1 to 10 (this is just test data to prove this works).

    Using the following block, we can test the code works:

    declare
      v_id my_test_type;
      v_ids my_test_type_a;
    begin
      v_id := my_test_type(1);
      v_ids := my_test_type_a();
      for i in 1.. 5 loop
        v_id := my_test_type(i);
        v_ids.extend;
        v_ids(i) := v_id; 
      end loop;
      my_test_proc(v_ids);
    end;
    / 
    

    So long as dbms_output is on, this should print 1 – 5, as the test data table is joined with your array!

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Specifically, suppose I start with the string string =hello \'i am \' me And
this is what i have right now Drawing an RSS feed into the php,

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.