472,373 Members | 1,626 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

How do I get an array into a resultset

I want to make an Stored Procedure on a Oracle 7.x database that fills
a resulset based on the values in an array:

CREATE OR REPLACE PACKAGE PCK_SET
IS
TYPE rec_set IS RECORD
( type_id NUMBER
, name VARCHAR2(30)
)

TYPE cur_set IS REF CURSOR
RETURN rec_set ;

TYPE arr IS TABLE OF NUMBER INDEX BY binary_integer ;
v_array arr ;

END PCK_SET ;
/

CREATE OR REPLACE PROCEDURE SP_GET_SET
( resultset IN OUT PCK_SET.cur_set
) AS
BEGIN
FOR x IN 1 ..PCK_SET.v_array.COUNT
LOOP
SELECT type_id
, name
INTO resultset
FROM SET_TABLE
WHERE arr_id = PCK_SET.v_array(x) ;
END LOOP ;
END SP_GET_SET ;

Normally I would do:
OPEN resultset FOR
SELECT type_id
, name
FROM SET_TABLE
where arr_id in (1,2,3, etc.)

Only the in-clause can be more than 254, so the ORA-01795 shows

This example does not give a resultset.
Jul 19 '05 #1
1 4131
Harrie K. wrote:

<snip!>
Normally I would do:
OPEN resultset FOR
SELECT type_id
, name
FROM SET_TABLE
where arr_id in (1,2,3, etc.)

Only the in-clause can be more than 254, so the ORA-01795 shows

This example does not give a resultset.

Normally, I would use a subselect - in clauses that large
should be tables, really.

--
Regards, Frank van Bortel

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Harrie K. | last post by:
I want to make an Stored Procedure on a Oracle 7.x database that fills a resulset based on the values in an array: CREATE OR REPLACE PACKAGE PCK_SET IS TYPE rec_set IS RECORD ( type_id NUMBER...
1
by: Hades | last post by:
Hi there :) I'm trying to make a client-server system, SOAP based. Both client and server modules are written in Python. I'm using ZSI libraries, abd Python version is 2.5. In my WSDL File I...
0
by: Hades | last post by:
Hi there :) I'm trying to make a client-server system, SOAP based. Both client and server modules are written in Python. I'm using ZSI libraries, abd Python version is 2.5. In my WSDL File I...
33
by: Adam Chapman | last post by:
Hi, Im trying to migrate from programming in Matlab over to C. Im trying to make a simple function to multiply one matrix by the other. I've realised that C can't determine the size of a 2d...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.