On Wed, Feb 06, 2002 at 06:12:38PM -0500, McElwee, wrote:
> Hi,
> 
> I'm capturing data from a proprietary database to a flat file and I want to
> create tables and insert rows of data into those tables. From what I've read
> as long as the number of columns matches the number of elements in a row I
> should be able to do wholesale inserts into the oracle database. I just need
> direction on how best to approach this. I was thinking of using a sql
> statement of the order:
> 
>      @row = $sth->dump_results(80, "\n", ':',\*CONTENT);
> 
>       foreach $x (@row){
>         $sql = "insert into $i values($x);
>         $sth = $dbh2->prepare($sql);
>         $sth->execute or die "Can't execute SQL statement: ",
> $sth->errstr(), "\n";
> 
> I know this won't work but am I moving in the right direction? Should I be
> using fetchrow_arrayref() to reference the rows? How would I use this in a
> sql statement? Perhaps I'm moving down a cul de sac, so any pointers in the
> right direction would be appreciated.
---end quoted text---

Look at late binding in Oracle it'll speed up the input of data since
the SQL template is optimised and stored in a buffer, since Oracle has
been informed that it is going to be reused many times. Of course it
depends on the number of inserts as to whether it pays dividends.

Personally I'd use fetchall_arrayref instead of dump_results but that
may be due to habit.

-- 
 Frank Booth - Consultant
Parasol Solutions Limited.
(www.parasolsolutions.com)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to