Page 1 of 1

how to change the language of database error messages

Posted: Wed 13 Feb 2013 08:08
by ysyang99
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

Re: how to change the language of database error messages

Posted: Thu 14 Feb 2013 15:30
by AlexP
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;