in reply to Re: db prepare failed:invalid character error : Perl DBI - Help plz
in thread db prepare failed:invalid character error : Perl DBI - Help plz

Hi Corion, Thanks for your response. Actually I am using place holders in my code.. Below is my code.. But still I am getting the error....Below is my code #!/usr/bin/perl use DBI; $ACCDBHOST = "host"; $ACCDBDB = "db"; $ACCDBUSER = "user"; $ACCDBPWD = "pwd"; $db = DBI->connect("DBI:Oracle:host=$ACCDBHOST;sid=$ACCDBDB",$ACCDBUSE +R,$ACCDBPWD); unless($db) { print "(ERROR) Failed to connect to $ACCDBHOST."; exit(1); } $scode = 198000031; my $sth1 = $db->prepare("SELECT 一時上司社員番号 FROM WF_WORKFLOW WHER +E 本人社員番号 = ?"); $sth1->bind_param(1,$scode1); $sth1->execute(); my $row1; while ( $row1 = $sth1->fetchrow_array( ) ) { print $row1; } $sth1->finish(); $db->disconnect();
Thanks Sri
  • Comment on Re^2: db prepare failed:invalid character error : Perl DBI - Help plz
  • Download Code

Replies are listed 'Best First'.
Re^3: db prepare failed:invalid character error : Perl DBI - Help plz
by graff (Chancellor) on Oct 15, 2007 at 08:28 UTC
    And are you saying that this is the exact code that produced the error message you showed us at the top of the thread?

    Have you tried redirecting stderr to a file? You may need to inspect the error message for non-printable byte values (e.g. using od or xxd or some other hex-dump tool).

    Does the Japanese version of Oracle actually support Japanese strings as column names in the database schema? What character encoding does it use? What version of perl are you using? How certain are you that the encoding used in the perl script matches what is used in the Oracle schema?