> Howdy: > Howdy > At the risk of sounding silly, does anyone know > of a way to export data from PostgreSQL to > Oracle via perl featuring DBI? > > Background: > > I'm running PostgreSQL 7.2.1 on RedHat Linux 7.2 > and I have Oracle 9i on the same box. PostgreSQL > is dying and the tool to dump the data (pg_dump) > no longer works (actually, it's due to a severe > problem with the PostgreSQL database ...) and > the best shot I have now are a few items: > > * use MS Access to migrate (shoot me now!)
Bang! > * use Perl > * use copy on PostgreSQL and sqlldr for Oracle > (and then figure out how to automatically make > schema/ table DDL for all 1500 tables) > > All of the options above have issues, however, I figured > that using Perl (DBI) would be better because I > could open up a connection between both databases > at the same time and just pipe the information > from one to the other. I'd open to handles: my $dbh_pg = DBI->connect(... my $dbh_or = DBI->connect(... $dbh_pg SELECT * FROM ... for(each row) { quote stuff here if necessary $dbh_or INSERT ... } Now this assumes you have the tables setup in Oracle properly. Check out perldoc DBI to see the specifices on syntax HTH DMuey > > For that to happen, I need to figure out how to > keep the data (from Pg) and open a new session > with Oracle and I don't know how to do that. I > can open up one or the other database and put > data into a file ... > > Unless there is a conversion / migration tool that I > don't know of, can someone point me to an example of > directly moving data from one database to another > via DBI? > > Thanks! > > -X > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]