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

In case it helps, it looks like the Japanese in the OP (original post at the top of this thread) is using Shift-JIS, which makes sense for a unix system. Given that you are running 5.6.1 on Solaris, it's actually likely that your Oracle installation is using Shift-JIS as well (but I hope you will be able to check that out for sure).

Actually, I forgot to ask... is the oracle server on that same Solaris machine, or is it somewhere else? If it's somewhere else, it's more likely that you may need to figure out what encoding it uses.

To keep it simple, if you have any other kind of tool that can query and display content from that database, use that to try out some queries; if they work as expected, store the query strings and results in a file. For now, don't worry about what the character encoding is -- if you can read it and it makes sense, you've got the right encoding (that is, the one that works in your current environment).

Then try to write a perl script that will read the file, run the queries, and compare the results it gets against the results in the file. If it doesn't work, make sure the perl script writes its queries to a new output file, so you can compare that version of the query text against the original data that worked with the other tool. (You might need to use a hex-dump tool to do that comparison.)

  • Comment on Re^3: db prepare failed:invalid character error : Perl DBI - Help plz

Replies are listed 'Best First'.
Re^4: db prepare failed:invalid character error : Perl DBI - Help plz
by Anonymous Monk on Oct 17, 2007 at 01:15 UTC
    HI ,
    still I am getting the error.. Oracle Insatlled in Japanses. NLS_LANG = JAPANESE NLS_CHARACTERSET = ja16EUC 1. I saved my perl file and converted my file to euc-JP using iconv. 2.set OS Language is EUC got the same error , here what I notice that the error messgae showing + the exact query. (I think it means its trying to pass the correct qu +ery to Oracle) But showing invalid character after SELECT . But the same query what ever perl is trying to pass to oracle , execut +ing pefectly in SQLPLUS. Where is the problem here? Also tried with charset SJIS and UTF-8.. getting the same error..
    Thanks Sri
Re^4: db prepare failed:invalid character error : Perl DBI - Help plz
by srini_sun (Initiate) on Oct 16, 2007 at 15:57 UTC
    Hi,
    HI , still I am getting the error.. Oracle Insatlled in Japanses. NLS_LANG = JAPANESE NLS_CHARACTERSET = ja16EUC 1. I saved my perl file and converted my file to euc-JP using iconv. 2.set OS Language is EUC got the same error , here what I notice that the error messgae showing + the exact query. (I think it means its trying to pass the correct qu +ery to Oracle) But showing invalid character after SELECT . But the same query what ever perl is trying to pass to oracle , execut +ing pefectly in SQLPLUS. Where is the problem here? Also tried with charset SJIS and UTF-8.. getting the same error.. Thanks Sri