in reply to Re^2: Concurrent access to db2 and sybase databases
in thread Concurrent access to db2 and sybase databases

mayankshah:

Oh, I see what you want. Yeah, you can't expect two databases to be able to share a single database connection. However, you can get the results you want using something like the (untested) bit below:

$dbh1->connect("to db2 database"); $dbh2->connect("to sybase database"); $sth1=$dbh1->prepare("select apples, bananas from fruit_salad"); $sth2=$dbh2->prepare("insert snack (apples, bananas) values (?,?)"); $sth1->execute(); while (@row=$sth1->fetchrow_array()) { $sth2->execute(@row); }

This way, you get the data out of your statement handle in a nice, simple array which you feed to your *other* statement handle.

...roboticus

Replies are listed 'Best First'.
Re^4: Concurrent access to db2 and sybase databases
by mayankshah (Initiate) on Mar 27, 2008 at 05:54 UTC
    thanks it worked
Re^4: Concurrent access to db2 and sybase databases
by mayankshah (Initiate) on Mar 27, 2008 at 13:51 UTC
    thanks a ton it worked