Hi Team,
We are using DBI module in one of our product.
Following is the sample code :
#!/usr/bin/perl
use strict; use DBI;
my $dbh = DBI->connect("dbi:oracle:npm", "username", "password");
#my $name = "Anand"; my $name = "ranù.it1";
my $sth = $dbh->prepare("SELECT * FROM tablename WHERE name = ?");
$sth->bind_param(1, $name); $sth->execute();
my ($name, $address) = $sth->fetchrow();
print "$name $address \n"; $sth->finish();
$dbh->disconnect();
We are able to retrieve the values from tablename for name Anand (ascii
character). But we are not able to retrieve the values from tablename
for name "ranù.it1" (non-ascii character). Name "ranù.it1" exists in
tablename .
Please help us know how to resolve this issue.
We are using below software and version for development:
DBI version : 1.605
Perl Version : 5.8.8
Oracle version : 10.2.0.5
bash-3.00# locale
LANG=
LC_CTYPE=en_CA.ISO8859-1
LC_NUMERIC=en_CA.ISO8859-1
LC_TIME=en_CA.ISO8859-1
LC_COLLATE=en_CA.ISO8859-1
LC_MONETARY=en_CA.ISO8859-1
LC_MESSAGES=C
LC_ALL=
bash-3.00# echo $LNS_LANG
It will fail for every user which contains diacritical marks(ù).
We are not doing any encoding/decoding.
sql > select * from nls_database_parameters
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.5.0
sql > select * from nls_session_parameters;
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
sql > select * from nls_instance_parameters;
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_SORT
NLS_DATE_LANGUAGE
NLS_DATE_FORMAT
NLS_CURRENCY
NLS_NUMERIC_CHARACTERS
NLS_ISO_CURRENCY
NLS_CALENDAR
NLS_TIME_FORMAT
NLS_TIMESTAMP_FORMAT
NLS_TIME_TZ_FORMAT
NLS_TIMESTAMP_TZ_FORMAT
NLS_DUAL_CURRENCY
NLS_COMP
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
Thanks & Regards,
Avinash