DBD::Sybase does not handle character conversions - this is done at the
OpenClient level (i.e. FreeTDS in your case).
Make sure that the locale that is set for your two servers are the same,
and that the charset that is defined on the database server (run
sp_helpsort in a SQL command window).
Michael
Extranet
[EMAIL PROTECTED] - 09/08/2006 01:15
To: dbi-users
cc:
Subject: DBI-Sybase query returning weird characters
All -
I am running a Solaris server with freetds and the DBI-sybase to access a
Netcool database, which is based on Sybase. This is working great. I tried
installing the exact same setup on another server and am seeing some very
odd results when I try to return any integer values. Instead of numbers it
is returning weird characters (hearts, diamonds, nulls etc) ☺♦♦☻. I have
installed and re-installed DBI, DBD-Sybase and freetds with the exact
version that is running on my other server, but no luck. I can go into tsql
and run the exact same query as in my script and it returns the results
correctly. This leads me to believe it is a DBD-Sybase issue. I have also
ftp'ed my script over to my working server and it works fine there.
Server: Solaris 8
Perl: 5.8.3
freetds: 0.63
DBI: 1.47
DBD-Sybase: 1.05
The script:
#!/usr/bin/perl
print "starting\n";
use DBI;
$netcool = DBI->connect( 'dbi:Sybase:FIBERPRI', 'username', 'password', {
RaiseError=> 0, PrintError => 0, AutoCommit => 1 } ) or die "failed" .
$DBI::errst;;
if ($netcool) {
$select = $netcool->prepare(qq{select Severity from status where
Node like 'dls030'});
$select->execute;
while($sev = $select->fetchrow_array)
{
print "Severity: $sev\n";
}
} else {
print "FAILED";
}
print "end";
RESULTS:
cs_config(CS_LOC_PROP) failed at /usr/local/lib/perl5/5.8.3
/sun4-solaris/DynaLoader.pm line 249.
DBD::Sybase - can't get server version
Severity:
Severity:
Severity: ☻
Severity: ☻
Severity: ☻
Severity: ☻
Severity: ☺
Severity:
Severity:
Severity:
Severity:
Severity:
Severity: ☺
Severity:
Severity: ☻
Severity:
Severity:
Severity:
Severity:
Severity:
Severity:
Severity:
Severity: ☺
Severity:
Severity:
Severity:
Severity:
Severity:
Severity:
Severity: ☺
Severity: ☺
Severity: ☺
Severity:
Severity:
Severity:
Severity:
end
Note I get the cs_config error on my "good" server as well, doesn't seem to
effect it.
Any ideas would be appreciated.
Thanks,
-Ric
This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.
---------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.