select through DBD::CSV
- From: rh62121@xxxxxxxxx (radek)
- Date: 22 Apr 2005 08:46:50 -0700
Hi,
this is my test script:
use DBI;
use encoding 'utf-8';
use strict;
use warnings;
my ($dbh,$sth,$col1,@test);
$dbh = DBI->connect("DBI:CSV:csv_sep_char=\\|;",{RaiseError => 1})
or die "Cannot connect: " . $DBI::errstr;
$sth = $dbh->prepare("SELECT * FROM test WHERE col1 = ?")
or die "Cannot prepare: " . $DBI::errstr;
$col1 = 'šš';
$sth->execute($col1) or die "Cannot execute: " . $DBI::errstr;
@test = $sth->fetchrow_array;
$sth->finish;
$dbh->disconnect;
print "line: @test\n";
The script prints šš zz. (š = latin small letter s with
caron)
test db and script encoding are the same.
test db lines:
col1|col2
šš|zz
1. if I remove encoding pragma data is retrieved
2. if I remove encoding pragma and replace comparison operator = with
LIKE operator data is retrieved
3. if I enclude encoding pragma with LIKE operator in select there is
no match - WRONG
4. if I enclude encoding pragma with LIKE operator in select and use
ASCII characters in where, e.g for col2, data is retrieved
What's the reason or is it a bug in DBD::CSV?
Thank you for suggestions.
Radek H.
.
- Prev by Date: Re: cant make db1-1.48
- Next by Date: Re: Stored Procedures
- Previous by thread: cant make db1-1.48
- Next by thread: select through DBD::CSV
- Index(es):
Relevant Pages
|
|