Re: Multiple Insert in Oracle
Date: 1995/12/01
Message-ID: <DIx50r.K7t_at_txnews.amd.com>#1/1
ln21aib_at_btp.fac.alcatel.it (Piebro) wrote:
>Hi. I am a newbie user of Oracle and I have a trouble.
>I am involved on a porting of a software package from Windows 3.x to
>SunOs. This package does use of BTRIEVE database. On BTRIEVE I can
>prepare in a memory area a number of records and then make only one INSERT operation
>to insert all records in database at same time.
>Can I do the same operation on ORACLE system ????
>Please Help Me.
>Thanks a lot.
>My email address is: ln21aib_at_fasm3c.btp.fac.alcatel.it.
>
You can do it in Pro*C or any Embedded SQL program using a host array.
Example
Suppose you have a table t1 with columns (c1, c2, c3)
You can define a host array for each of these columns in your host program.
Say
int c1[100]; int c2[100]; int c3[100];
then set the values of the array elements in your program.
The following statement will insert into t1 all the records that you have defined in your arrays at one shot.
EXEC SQL INSERT INTO t1 VALUES (:c1, :c2, :c3);
Hope it answers your query,
Regards,
Suman.
Received on Fri Dec 01 1995 - 00:00:00 CET