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

The Archive Base Latest Questions

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

I have a bunch of functions with signatures like: FUNCTION func1 (par1 IN VARCHAR2,

  • 0

I have a bunch of functions with signatures like:

FUNCTION func1 (par1 IN VARCHAR2, par2 IN NUMBER) RETURN my_rec;  

and I have a function for retrieving data from this bunch of functions:

FUNCTION get_result (func_name IN VARCHAR2, par1 IN VARCHAR2, par2 IN NUMBER) RETURN my_rec;
IS
    rec1 my_rec;
BEGIN
    EXECUTE IMMEDIATE 'SELECT ' || func_name || '(:par1, :par2) FROM DUAL'
    INTO rec1
    USING IN par1, IN par2;

    RETURN rec1;
END;

but this code fails with ORA-01007 ‘variable not in select list’.
How can I rewrite statement?

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

    It all works fine for me (Oracle 10G), one I correct the syntax error in your function definition (the unwanted semi-colon on the first line):

    SQL> create type my_rec is object (id integer, name varchar2(30))
      2  /
    
    Type created.
    
    SQL> create FUNCTION func1 (par1 IN VARCHAR2, par2 IN NUMBER) RETURN my_rec
      2  is
      3    l_rec my_rec := my_rec (1, 'x');
      4  begin
      5     return l_rec;
      6  end;
      7  /
    
    
    Function created.
    
    SQL> CREATE OR REPLACE
      2  FUNCTION get_result (func_name IN VARCHAR2, par1 IN VARCHAR2, par2 IN NUMBER) RETURN my_rec
      3  IS
      4      rec1 my_rec;
      5  BEGIN
      6      EXECUTE IMMEDIATE 'SELECT ' || func_name || '(:par1, :par2) FROM DUAL'
      7      INTO rec1
      8      USING IN par1, IN par2;
      9      RETURN rec1;
     10  END;
     11  /
    
    Function created.
    
    SQL> select get_result ('func1',1,2) from dual;
    
    GET_RESULT('FUNC1',1,2)(ID, NAME)
    -------------------------------------------------
    MY_REC(1, 'x')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of functions that look like this 'tea' : function (caller)
For example I have bunch of functions like these: function a() { //do something
I have a bunch of Javascript functions that look like the following: function generateBusinessImage
I have a bunch of functions like: method1 , method2 , method3 . For
I have a bunch of overloaded functions that operate on certain data types such
I have a bunch of functions like: f1 :: String -> String -> ...
I have a bunch of very simple functions. Each function has one input and
I have some binary data which contains a bunch of functions and want to
My case is as follows : I have a bunch of functions and declarations
I have a bunch of generated functions from a supplier's tool are required to

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.