TORASCRIPT : No mapping for the Unicode character exists in the target multi-byte code page

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eric.garcia38
Posts: 5
Joined: Wed 20 Dec 2017 03:05

TORASCRIPT : No mapping for the Unicode character exists in the target multi-byte code page

Post by eric.garcia38 » Thu 04 Jan 2018 23:15

Hy Guys,

I have an issue when trying to update a Clob with a script containing this kind of char ¿ .
When I remove it works very well.
I use a Torasession in Direct mode. with all the default values options.
ANy idea ?

thx for your help.

eric fg

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TORASCRIPT : No mapping for the Unicode character exists in the target multi-byte code page

Post by MaximG » Fri 05 Jan 2018 09:57

Please specify whether you use the UseUnicode and UnicodeEnvironment options in your project:

Code: Select all

        OraSession.Options.UseUnicode := True;
        OraSession.Options.UnicodeEnvironment := True;

eric.garcia38
Posts: 5
Joined: Wed 20 Dec 2017 03:05

Re: TORASCRIPT : No mapping for the Unicode character exists in the target multi-byte code page

Post by eric.garcia38 » Fri 05 Jan 2018 14:36

yes I tried to put these 2 properties to false and the True : But always get the same issue.

eric

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TORASCRIPT : No mapping for the Unicode character exists in the target multi-byte code page

Post by MaximG » Fri 05 Jan 2018 15:14

Please provide a small code snippet showing how you change the value of the CLOB field. In addition, please specify the NLS parameters of the Oracle server you are using

eric.garcia38
Posts: 5
Joined: Wed 20 Dec 2017 03:05

Re: TORASCRIPT : No mapping for the Unicode character exists in the target multi-byte code page

Post by eric.garcia38 » Fri 05 Jan 2018 15:32

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 BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE


I get the issue when trying to execute a script which is a Package, with a special Char inside.
orasession:Torasession;
orascript:TERIC_Orascript;

s:Tstringstream;
begin
orasession:=Torasession.Create(nil);
orasession.Options.UnicodeEnvironment:=true;
orasession.Options.UseUnicode:=true;
orascript:=TERIC_Orascript.Create(nil);
orascript.Session:=orasession;
orasession.ConnectString:=orasessionENV.ConnectString;
orascript.AfterExecute:=OraScriptAfterExecute;
orascript.beforeexecute:= OraScriptBeforeExecute;
orascript.onerror:= OraScriptError;

try
begin
orascript.Numstatement:=0;
orascript.patchko:=false;
orascript.errorcolumn:=0;
orascript.Kalready:=false;


try
try
formaterror(INFO,trim(scriptfile) + ' started:' ,'initmaster2');
orascript.ExecuteFile(trim(scriptfile)); <------ error is raised here




----------------------------------- When I upload my script inside a Clob
stream: TStringStream;


prcc.parambyname('SQLSTMORIGINAL').DataType := ftOraClob;
stream := TStringStream.Create(sql.text);
try
stream.Position := 0;
prcc.parambyname('SQLSTMORIGINAL').LoadFromStream(stream, ftOraClob);
finally
stream.free;
end;



------------ When I download the script from the clob
ostr: Tstream;

ostr := prcc.CreateBlobStream(prcc.Fields[4], bmRead);
try
sql.Clear;
sql.LoadFromStream(ostr);

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TORASCRIPT : No mapping for the Unicode character exists in the target multi-byte code page

Post by MaximG » Tue 09 Jan 2018 12:06

To investigate the issue, please:

a) provide the results of the query Select * From v$nls_parameters Where Parameter = 'NLS_CHARACTERSET' in your environment
b) provide the value of the parameter "Current language for non-Unicode programs" of your Windows version
c) compose and send us a small full sample, execution of which causes the issue. This sample should include
the used scriptfile. It is convenient to do this using the e-support form (https://www.devart.comthe "Support"\"Request Support" menu)

Post Reply