freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Freetds, migration problem: Unterminated quoted string
- From: "Antonio Padilla" <apadilla AT ease.com.ve>
- To: freetds AT franklin.oit.unc.edu
- Subject: Freetds, migration problem: Unterminated quoted string
- Date: Wed, 13 Dec 2000 09:37:26 -0500
Dear fellows,
I doing a migration process from a SQLServer 7.0 DB to a Linux box under
intel, with PostgreSQL 7.0.2 on i586-pc-linux-gnu, compiled by gcc 2.95.2,
I'm using freetds with-tdsver=4.2 and enable-msdblib, the script used is
under PERL.
>>>>>>>>>>>>>>>>>>>>> begin of migration <<<<<<<<<<<<<<<<<<<<<<<<<<<
use DBI; # Load the DBI module
use DBD::Sybase;
use strict;
my $msDSN;
my $msUSER;
my $msPASS;
my $mUser = "insudb";
my $mPasswd = "insudb";
my $mDBSqlserverVtime;
my $mDBPostgresEis;
$ENV{'SYBASE'} = '/usr/local/freetds';
&ConnectDB();
my $sSelectClient;
$sSelectClient= $mDBSqlserverVtime->prepare(q { Select
ClientSerial , # integer example: 1
ClientId , # char(14)
example:'P0000000000041'
Speciality , # smallint example: 1
SpecialityDes # varchar(30) example: 'Doctor'
from eis_client});
my $sInsert= $mDBPostgresEis->prepare( q { INSERT INTO Client
(ClientSerial , # integer example: 1
ClientId , # char(14) example:
'P0000000000041'
Speciality , # smallint example: 1
SpecialityDes # varchar(30) example: 'Doctor'
)
VALUES
( ? , ? ,? , ? ) });
$sSelectClient->execute() or die 'execute fail: $DBI::errstr\n";';
@CopyTable = $sSelectClient->fetchall_arrayref;
my $nTotalRows = $#{$CopyTable[0]};
my $nIndexRec = 0;
while ($nIndexRec <= $nTotalRows ){
@sVarAux = @{$CopyTable[0][$nIndexRec]};
$sInsert->execute(@sVarAux ) ||
die "Insert fail: $DBI::errstr\n"; ### ERROR
$nIndexRec++;
}
$sSelectClient->finish;
$sInsert->finish;
@sVarAux = undef;
@CopyTable = undef;
&DisConnectDB();
>>>>>>>>>>>>>>>>>>>>>>>> End of the script <<<<<<<<<<<<<<<<<<<<<<<<<<<
The connection and disconnection to both database are well done.
Now I changed my script to other machine, with the following
characteristics
Data General Aviion
Pentium intel pro 200 Mhz
128 Mb Ram
2 x 2Gb Hdd Scsi
and Linux Suse 6.4 kernel 2.2.14
The Original one was an Acer Power P75
Pentium intel 75 Mhz
32 Mb Ram
1.2Gb Hdd Ide
and Linux Mandrake 7.0 kernel 2.2.14
The Postgres DB version are the same:
PostgreSQL 7.0.2 on i586-pc-linux-gnu, compiled by gcc 2.95.2
The Perl version is 5.0.6 in both cases
All modules used are the same, DBI, DBD::Sybase, DBD::PG and so on.
The origin data is the same, SQLServer 7.0
So, everything is ok, except the machine and the linux version.
The problem occurs, after I run my script in the new machine:
Insert client fail: ERROR: Unterminated quoted string -- see the line
with the comment #ERROR
So, I run my program with a debugger, and I discovered that the array is
filled with
DB<1> x @sVarAux
0 1
1 "Q0000000000009\c@"
2 14
3 "Police\c@"
DB<2>
And in the old machine is filled by following way:
DB<1> x @sVarAux
0 1
1 "Q0000000000009"
2 14
3 "Police"
DB<2>
I think that the error is clear the strange characters "\c@", are
producing the error.
So my question is: Freetds is working ok?, or is other component?
I will appreciate any idea
Thanks is advance
Antonio Padilla
- Freetds, migration problem: Unterminated quoted string, Antonio Padilla, 12/13/2000
Archive powered by MHonArc 2.6.24.