473,414 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 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 4199
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.