Re: ORA-12704: character set mismatch problem with DBD::Oracle



On 2005-01-25 14:43:54 -0500, Jim Lynch wrote:
> It's not being set that way. It is a variable that was loaded by a
> select from another table. It's a string as far as perl is concerned
> but in this case the DBD routines are screwing it up, I believe. My
> mistake for not showing compilable code, what I meant to say was if I
> set the variable $serial to the character string "abc" it works, but if
> it is set to the character string "0800690C0A" it fails.

I have a similar problem. However the difference between "it works" and
"it doesn't work" seems to be if the parameter is a perl UTF-8 string:

% export PERL_UNICODE=SAL
% /usr/local/bin/perl =dumpsql 'select * from login where logname=?' hjp
DBD::Oracle::st execute failed: ORA-12704: character set mismatch (DBD ERROR: error possibly near <*> indicator at char 37 in 'select * from login where logname=:p1<*>') [for Statement "select * from login where logname=?" with ParamValues: :p1="hjp"] at /home/hjp/bin/dumpsql line 68.
ID LOGNAME PERSON MD5
DBD::Oracle::st fetchrow_array failed: ERROR no statement executing (perhaps you need to call execute first) [for Statement "select * from login where logname=?" with ParamValues: :p1="hjp"] at /home/hjp/bin/dumpsql line 88.

% export PERL_UNICODE=SL
% /usr/local/bin/perl =dumpsql 'select * from login where logname=?' hjp
ID LOGNAME PERSON MD5
5731 hjp 5611
bernon:~/tmp 15:01 186%

("dumpsql" is a small perl script which does basically only connect,
prepare, execute, fetchrow_array. "A" in PERL_UNICODE means command line
arguments are UTF-8).

Note that the string "hjp" itself doesn't contain any non-ascii characters.

This happens with

perl, v5.8.6 built for i686-linux
DBI 1.48
DBD::Oracle 1.16
linked against Oracle 8.1.7, I believe.
The database is also Oracle 8.1.7. It seems to work if the database is
Oracle 9.2.

I cannot reproduce the problem with

perl, v5.8.3 built for i386-linux-thread-multi
DBI 1.46
DBD::Oracle 1.15

on the same machine.

hp

--
_ | Peter J. Holzer | In our modern say,learn,know in a day
|_|_) | Sysadmin WSR | world, perhaps being an expert is an
| | | hjp@xxxxxxxxx | outdated concept.
__/ | http://www.hjp.at/ | -- Catharine Drozdowski on dbi-users.

Attachment:pgp3FfOFnjaRG.pgp
Description: PGP signature



Relevant Pages

  • Cant Compiling perl5.8.8 on FreeBSD6.2
    ... WITH_DEBUGGING=yes Build perl with debugging support. ... First let's make sure your kit is complete. ... What is the file extension used for shared libraries? ... I'll use sprintf to convert floats into a string. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: When is a string a number?
    ... whether something read from the database is a string ... or a number in Perl purely depends on the context it is used in so: ... number or a string. ... I moved from JSON to JSON Syck. ...
    (perl.dbi.users)
  • Re: use of DBI; I am getting multiple error messages mixed in with ?the correct output.
    ... But I'm not talking about C++ or Java or SQL. ... This is a perl newsgroup. ... to means by a "defined null string", as opposed to an undefined value. ... And where exactly are you getting the idea that the empty string is a ...
    (comp.lang.perl.misc)
  • Database insertion, escape issue
    ... I have a Perl script where I try to strip some data from a web page ... I am capturing the paragraphs of text and inserting ... I am currently trying this with a SQLite database. ... # Create the file string ...
    (perl.beginners)
  • Re: Perl Strings vs FileHandle
    ... Just wanted to run this through Perl gurus to see if fit is ... testing it every time through the loop. ... The comparison test to the string '1' is superfluous. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)