Re: Including application-generated data in an SQL query

From: Raoul Gough <raoulgough_at_my-deja.com>
Date: 2000/02/15
Message-ID: <88bp2b$fdm$1_at_nnrp1.deja.com>#1/1


In article <0mUp4.20364$W4.1023725_at_news1.rdc1.on.wave.home.com>,   "Mark Malakanov" <markmal_at_home.com> wrote:
> Solutions:
> 1. Context Option
> 2. OCI (oracle call interface) supports arrays of rows for SQL.
> 3. Is INSERT INTO TEMP_TABLE SELECT ID FROM.... too slow?
>

Thanks for the solutions - I don't understand what you meant by the first option and I don't think the OCI option is available with ESQL/C under Oracle RDB (somebody correct me if I'm wrong) but I managed to make something of the third option as follows:

Using the in-memory list of report ID's I can do an insert into the temporary table something like this:

INSERT INTO TEMP_TABLE
SELECT ID FROM PERMANENT_TABLE
WHERE ID IN (id_0, id_1, ..., id_n);

This performs the inserts a lot quicker since it writes n rows at a time. From my testing, this performs around a factor of n faster than inserting the IDs one at a time.

Thanks for the help,
Ray.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Feb 15 2000 - 00:00:00 CET

Original text of this message