Question

Asked on 2006-03-24 at 06:33:15ID: 25469068

Passing Varray to procedure and use in query

by: zreak500

Rating9.4Excellent

How can I use a pl/sql array in a sql-statement?
I want to do something like (shortened):

   BEGIN find_objects(grouplist('A','B','C','D','E','F'), :returned);

   CREATE OR REPLACE TYPE grouplist AS varray(20) OF varchar2(20);
   PROCEDURE find_objects (price_group_in IN grouplist, return_value IN OUT objectlist);
      SELECT * FROM objects WHERE objects.price_group IN price_group_in

But when I try to create the procedure it throws me this error.
ORA-00932: inconsistent datatypes: expected NUMBER got MYUSER.GROUPLIST

It works if I replace the select-line with this:
      SELECT * FROM objects WHERE objects.price_group IN ('A','B','C','D')

  1. select columns outside MINUS query
    I am writing a oracle sql that selects the rows from first query minus the rows from second query and that works great but I want to select corresponding columns from the same table not impacting the results of the query.. for example select productA from product_table where product_catalog = 'CUSTOM' minus select productA from product_table…
  2. Hirarchical select list / query
    Hey guys! I am working with Oracle Apex and need to create a select list with hirarchical order. Assuming I have a table "TBL_ARBEITSSCHRITTE" containing 130 rows, there are 4 rows, which should stand out. All others should be inline and related to those 4 main records. Is it somehow possible using the primary key and …
  3. how to add '' in select query
    Hey; I have a select query select substr(accountname,4,7) from account where ..... The result is showing: u111111 u222222 u333333 However i want to show as ('u111111','u222222','u333333') for our adapter input purpose. Can i do it in query? …
  4. Select distinct
    The "my_table" has three PKs ( nde_id, nid, sequence). I need to insert a big volume of data (more than two millions) and the code that I'm selecting is returning duplicates which would not allow me to insert the way I'm trying (which is the code I have provided). If I try to use cursor (which would loop and an exception would let …
  5. Record count on Database Block
    Hi all, I have 2 canvas (1 canvas having database block items ,2nd having control block items & FIND button also in Control block), My requirement is when i select any one of the lov and click on the find button(in 2nd canvas , control block canvas) then it navigates to the database block canvas and displays records, at that time i want to …

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
array procedure varray
Participating Experts
1
Solution Grade
A

Replies

 by:

Posted on 2006-03-24 at 08:05:03ID: 28290442

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: zreak

Posted on 2006-03-24 at 09:20:13ID: 28290443

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: RCorfman

Posted on 2006-03-24 at 09:40:50ID: 28290444

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: zreak

Posted on 2006-03-24 at 10:08:07ID: 28290445

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: RCorfman

Posted on 2006-03-24 at 10:23:24ID: 28290446

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert