how to change the language of database error messages

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ysyang99
Posts: 16
Joined: Tue 04 Dec 2012 08:43

how to change the language of database error messages

Post by ysyang99 » Wed 13 Feb 2013 08:08

I use ODAC 8.5.9 for Delphi 2009 , Oracle Database 10g Enterprise Edition 10.2.0.3.0

My sample code is

Server : NLS CHARSET = KOREAN_KOREA
Oracle Client Registry : NLS_LANG = KOREAN_KOREA.KO16MSWIN949

/*
* Direct Session Test
*/

Code: Select all

Orasession.Direct := true;
Orasession.Connect;
SmartQuery2.SQL.Text = 'INSERT INTO1 HR.FLOAT_TABLE(AAA,BBB) VALUES (1,1.0)'; //this code is error
SmartQuery2.Execute; 
=> ORA-00925: missing INTO keyword

Code: Select all

Orasession.Direct := true;
Orasession.Connect;
OraSession1.ExecSQL('ALTER SESSION SET NLS_LANGUAGE = ''KOREAN'' ',[]);
SmartQuery2.SQL.Text = 'INSERT INTO1 HR.FLOAT_TABLE(AAA,BBB) VALUES (1,1.0)'; //this code is error
SmartQuery2.Execute; 
=> ORA-00925: INTO 키워드가 누락되었습니다.

code above normal
--------------------------------------------------

Code: Select all

/*
 * OCI Session Test
*/

Orasession.Direct := false;
Orasession.Connect;
SmartQuery2.SQL.Text = 'INSERT INTO1 HR.FLOAT_TABLE(AAA,BBB) VALUES (1,1.0)'; //this code is error
SmartQuery2.Execute; 
=> ORA-00925: missing INTO keyword

Code: Select all

Orasession.Direct := false;
Orasession.Connect;
OraSession1.ExecSQL('ALTER SESSION SET NLS_LANGUAGE = ''KOREAN'' ',[]);
SmartQuery2.SQL.Text = 'INSERT INTO1 HR.FLOAT_TABLE(AAA,BBB) VALUES (1,1.0)'; //this code is error
SmartQuery2.Execute; 
=> ORA-00925: ????????
------------------------------------------------------
Characters of error message is broken.

How can characters display correctly?

Request for help.

Thank you

Yongsung Yang

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: how to change the language of database error messages

Post by AlexP » Thu 14 Feb 2013 15:30

hello,

To display correct symbols in Oracle messages in the OCI mode, the charsets of client and server must be the same. Please check the client settings

Code: Select all

SELECT USERENV('language') from dual;

Post Reply