[freetds] Please help with my script

ZIGLIO Frediano Frediano.Ziglio at vodafone.com
Fri May 23 11:37:16 EDT 2003


> 
> Hello,
> 
> I am trying (unsuccessfully) to extract data from a mssql7 
> database to a mysql database. The database is over 10,000 
> records and each record contains a OLE .jpg blob.
> 

Currently FreeTDS support all mssql2k except sql_variant.
I don't know where ou store a "OLE .jpg blob"...

> Basically, I am having problems importing the data. My script 
> is below...
> 
> 
> #!/usr/bin/perl
> 
>  use DBI;
>  $ENV{'SYBASE'} = '/usr/';
>  $dbh = DBI->connect('dbi:Sybase:server=XXX', 'XXX', 'XXX')
>       or die 'connect';
> 
> $dbh->do("use mlsnhsql");
> 
> $sth = $dbh->prepare('select * from idxmls1') or die 
> 'prepare'; $sth->execute or die 'execute';
> 
> while (@data = $sth->fetchrow_array) {
>     print "$data[0] $data[1] $data[2] $data[3] $data[4] 
> $data[5] $data[6] $data[7] $data[8] $data[9] $data[10] 
> $data[11] $data[12] $data[13] $data[14] $data[15] $data[16] 
> $data[17] $data[18] $data[19] $data[20] $data[21] $data[22] 
> $data[23] $data[24] $data[25] $data[26] $data[27] $data[28] 
> $data[29] $data[30] $data[31] $data[32] $data[33] $data[34] 
> $data[35] $data[36] $data[37] $data[38] $data[39] $data[40] 
> $data[41] $data[42] $data[43] $data[44] $data[45] $data[46] 
> $data[47] $data[48] $data[49] $data[50] $data[51] $data[52] 
> $data[53] $data[54]\n"; # the first few fields }
> 

Perhaps problem is textsize too small..

freddy77



More information about the FreeTDS mailing list