Skip to Content.
Sympa Menu

freetds - [freetds] exporting data from ODBC to mysql

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Scott Antonivich" <scott AT tpk.net>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] exporting data from ODBC to mysql
  • Date: Tue, 20 May 2003 10:32:09 -0400

Hello,

Please bare with me as this is all new territory for me. Here is what I want
to do:

I installed freetds on a RedHat Linux 8.0 box. I am trying to connect and
export a table from a mssql7 database. Below is the script that I am using:

#!/usr/bin/perl

use DBI;
$ENV{'SYBASE'} = '/usr/';
$dbh = DBI->connect('dbi:Sybase:server=XXX', 'XXX', 'XXX')
or die 'connect';

$dbh->do("use XXX");

$sth = $dbh->prepare('select * from XXX') or die 'prepare';
$sth->execute or die 'execute';

while (@data = $sth->fetchrow_array) {
print "$data[0] $data[1] $data[2]\n"; # the first few fields
}

$sth->finish;
$dbh->disconnect;




My question is how do I modify the above script to get the data from a
specific table and imput it into a specific myswl database on my linux box?

Thank you for the help.


Scott





Archive powered by MHonArc 2.6.24.

Top of Page