If the tables were exactly the same this will work  You may need to tweak for
your purpose.

$sdbh ## is your sybase database handle.
$odbh ## is your oracle database handle.

$ssth = $sdbh->prepare("select * from table_name");
$ssth->execute();

$osth = $odbh->prepare("insert into table_name (field1, field2) values (?, ?)");

while ( my $rec = $ssth->fetchrow_arrayref() ){
  $osth->execute( @{ $rec } );
}
$ssth->finish;
$osth->finish;

$sdbh->disconnect;
$odbh->disconnect;

"Rice, Wayne R (Sybase)" wrote:
> 
> I wish to do a bulk insert into select from of all rows.
> I have my connection to Oracle (source) and Sybase (destination) set up and
> working.
> 
> What is the BEST and FASTEST way to do something like this:
> 
> insert into OraX select * from SybY       Note: the col names are the same
> and datatypes as close a possible.
> 
> ????
> 
> Thanks,
> Wayne Rice
> Sybase, Inc.
> Bethesda, MD
> Sybase V-mail: 301-896-1368
> Sybase E-mail: [EMAIL PROTECTED]
> NAVAIR Phone: 301-757-1657
> NAVAIR E-mail: [EMAIL PROTECTED]
> Cell Phone 443 540-7944
>  <<...OLE_Obj...>>

Reply via email to