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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:59:14+00:00 2026-05-14T22:59:14+00:00

I have a function that takes as one of it’s arguments a VARRAY of

  • 0

I have a function that takes as one of it’s arguments a VARRAY of pl/sql Objects. How do I execute this stored procedure and bind the resultset that it returns to a data grid in TOAD for Oracle?

  • 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-14T22:59:15+00:00Added an answer on May 14, 2026 at 10:59 pm

    After some searching around, I found the answer to my own problem. Say your varray type was called varchar_pair_array and the objects stored in this array were called varchar_pair_object. varchar_pair_object is a simple object that has two varchars as it’s members.

    Here is the code for executing a proc that takes in a varray of varchar_pair_object (s):

    DECLARE 
      RetVal SYS_REFCURSOR;
      a_simplevalue VARCHAR2(200);
      another_simplevalue VARCHAR2(200);
      my_array_of_varchar_pairs VARCHAR_PAIR_ARRAY; -- assume varchar_pair_array is defined somewhere else
      my_obj VARCHAR_PAIR_OBJECT; -- assume varchar_pair_object is defined somewhere else
      my_other_obj VARCHAR_PAIR_OBJECT;
    BEGIN 
      a_simplevalue := 'hello';
      another_simplevalue := 'there';
      my_obj := VARCHAR_PAIR_OBJECT('nice to meet you', 'greetings');
      my_other_obj := VARCHAR_PAIR_OBJECT('goodbye', 'ciao');
      my_array_of_varchar_pairs := VARCHAR_PAIR_ARRAY(); 
      my_array_of_varchar_pairs.EXTEND(2); -- this should be the number of objects you plan to put into the array
      my_array_of_varchar_pairs(1) := my_obj;
      my_array_of_varchar_pairs(2) := my_other_obj; 
    
      RetVal := my_function ( a_simplevalue, another_simplevalue, my_array_of_varchar_pairs); -- assuming your array takes two varchars and one array of VARCHAR_PAIR_OBJECT (s)
      :to_grid := RetVal;
    
    END;
    

    Copy paste this code in TOAD’s sql editor and change it to adapt to your function and types and hit F9. TOAD will ask you the type of the :to_grid variable. Select cursor (assuming your function returns a ref cursor) and hit enter. TOAD will bind the result set to a data grid.

    Links that helped me:

    http://www.smart-soft.co.uk/Oracle/oracle-plsql-tutorial-part-11.htm (good tutorial on collections)
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/10_objs.htm#1972 (especially useful in this case is the section on declaring and initializing objects)

    With very little change the same can be done with a procedure.

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

Sidebar

Related Questions

I have a function that takes two arguments, the first one $methodName being a
If I have a function that takes possession of one of the arguments, are
I have a javascript function (class) that takes a function reference as one paremter.
I have a function that takes variadic arguments, that I obtain from func_get_args() .
I have a function that takes an array of objects and I need to
So I have this function that takes all the users from an MySql table
I have a C++ function that takes one std::string as an argument and a
I have a function that takes 2 variables, one for the database connection and
Okay i've seen this done somewhere before where you have a function that takes
I have a function in my silverlight app, that takes one or two seconds

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.