开发者

Oracle character encoding

开发者 https://www.devze.com 2023-03-05 23:59 出处:网络
I have an MVIEW on the DEV server as CREATE MATERIALIZED VIEW MY_MVIEW AS SELECTcol1 AS \"N° INVOICE\" from TABLE

I have an MVIEW on the DEV server as

CREATE MATERIALIZED VIEW MY_MVIEW
AS
SELECT  col1 AS "N° INVOICE" from TABLE

The MVIEW has been installed on PROD server and when i check for its query i have the characther ° not recognized

SELECT query from user_mviews where mview_name = 'MY_MVIEW' ;

QUERY
---------------------------------------
SELECT  col1 AS "N? INVOICE" from TABLE

we use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production for both environments开发者_开发技巧 .

Any idea why this happened and how to correct it? or I need to rename my alias?


Whenever you see a question mark instead of a special character it means that the client's character set does not support that character and a conversion was not available.

The conversion happens with the database character set as the source and the client character set as the target. The environment variable NLS_LANG lets you control the client character set. NLS_LANG must be set before the connection is opened and it cannot be changed during the session.

For more information about NLS_LANG refer to the Oracle® Database Globalization Support Guide

BTW, NLS_LANGUAGE has nothing to do with the character set! It only controls language used in server messages and locale settings.


I would definitely recommend renaming your alias to something simple like NO_INVOICE that doesn't contain any unusual characters and doesn't need embedding in double quotes to reference. It is not appropriate to treat column names as if they are formatted headings for reports - do that in the report. With non-standard characters like this you are going to get problems with different environmental settings like NLS_LANG.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号