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

The Archive Base Latest Questions

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

I want to write a funcion or procedure that can be used in the

  • 0

I want to write a funcion or procedure that can be used in the IN clause of another procedure. The function or procedure would return ID numbers.

The main procedure would say something like

SELECT * FROM EMPLOYEES WHERE OFFICE_ID IN (GET_OFFICE_IDS);  -- GET_OFFICE_IDS requires no parameters 

GET_OFFICE_IDS returns a VARCHAR2 with the ID separated by commas. When I run the main procedure, I get a ‘ORA-01722: invalid number’ error which makes sense but I don’t know where I need to go from here.

Do I need GET_OFFICE_IDS to create a temp table that the main procedure uses? If so, will there be a performance penalty?

  • 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. 2026-05-11T05:27:22+00:00Added an answer on May 11, 2026 at 5:27 am

    Here is a working example of the nested table solution, using the EMP table:

    create type t_ids is table of integer /  create or replace function get_office_ids return t_ids is    l_ids t_ids := t_ids();    l_idx integer := 0; begin    for r in (select empno from emp where deptno=10)    loop       l_ids.extend;       l_idx := l_idx+1;       l_ids(l_idx) := r.empno;    end loop;    return l_ids; end; /  select ename from emp where empno in (select * from table(get_office_ids));   ENAME ---------- CLARK KING TEST MILLER BINNSY FARMER 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a procedure (function) that checks if a string contains another
I want to write a cmp -like function that compares two version numbers and
I want to write the following procedure / function: procedure ShowSysPopup(aFile: string; x, y:
I want to write a function which can validate a given value (passed as
i want to write a function that prints multi-dimensional objects which are text (or
I want to write 'twice' function that takes a function and an argument and
I want to write a function that read line by line from a socket
I have problem with fancybox. I want to write a function that will run
in Delphi the procedure write can handle: write(TF,st1) and write(TF,st1,st2,st3,st4); I want to declare
I want to create generic function that will need only parameter as Stored procedure

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.