PL/SQL arabic displayed as? - sql

When I query for data that have arabic text in PL/SQL Developer, It is showed as question marks (????).
I am sure the data is correctly stored in DB because it shows on website properly, also on the server.
So I think it is a problem related to my PL/SQL Developer (v8.0.4.1514).
Is there any way to change how PL/SQL Developer shows/encodes arabic text?
How to check in what format/encoding the arabic text is stored?
My question might be missing some details, So Just ask me and also keep in mind that I am very beginner in PL/SQL and in SQL.
Thank you.

I found a solution (which might also work with other languages that shows as '????')
I changed the NLS_LANG in registry to AMERICAN_AMERICA.AL32UTF8
(I found 3 NLS_LANG's in registry, check with each one or just change them all like I did.)
then restarted PL/SQL developer, test a query and arabic text is showing normally.
Thank you all.

can you SET NLS_LANGUAGE to Arabic by ALTER SESSION SET NLS_LANGUAGE = 'ARABIC'
it could be the solution, if not can you provide more information about O/S and it's version, ... etc

There might be multiple instance of oracle installed so you must set default enconding for all of them. Just follow this instructions:
Open reg edit and go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Oracle. There is one or more keys related to each instance:
For each of this keys right click and create a string value named NLS_LANG if not already there:
Then set it's value to AMERICAN_AMERICA.AL32UTF8 and done just refresh your query in PL/SQL.

in registery find NLS_LANG and change its value from AMERICAN_AMERICA.WE8MSWIN1252 to AMERICAN_AMERICA.UTF8
it works fine for me for persian characters.

Related

SQL French char encoding issue

I have an address with French chars - Vétéran. In table column it is read as Vétéran when using SMS select. The server language is English.
When I copied Vétéran to Word, it remained the same. I saved the Word doc as plain text using Windows default encoding (Western Europe), it is changed to Vétéran.
I cannot find a way to display it correctly in SMS. The data is copied from Oracle 12. It is displayed as Vétéran by Oracle SQL Developer.
Need some help.
Thanks,
Will
I tried different case and accent setting in collate. Does not work.

Why accents are not recognized in sqlplus

I have a subject table which has a theme field contains the following rows :
theme
-----
pays
économie
associée
And I have this basic query :
SELECT * FROM SUBJECT WHERE THEME='associée';
The query runs fine in Sql developer and returns the expected row to me.
On the other hand under Sqlplus it returns 0 lines to me (which is not normal).
I have the impression that the query does not recognize accented characters under sqlplus. I am thinking of an NLS_LANG problem but I do not know about it. Please help.
Thank you in advance.
Set your OS session's NLS_LANG variable to the value of, e.g., ENGLISH_AMERICA.AL32UTF8 and restart your SQL Developer. Retry afterwards.
If that didn't help, try also running your query as follows:
SELECT * FROM SUBJECT WHERE THEME = n'associée';
Notice the n before the string literal. That's a nvarchar2 string literal modifier. Depending on your DB charset/national charset settings you may need to explicitly state that the value you are querying for, is "national charset", not just a "regular charset".
If that didn't help, there's actually a multitude of additional variables that come into play when working with accented characters against an Oracle DB.
Explanation:
Your SQL Developer does recognize accents... provided that you have your Oracle DB session using character set compatible with your database character set. And your Oracle DB session's character set can be set either on OS level (via OS environment variable) or, possibly(!), in SQL Developer's options directly. Alas, the said multitude of other factors may include (though not exclusively):
your OS regional settings,
your OS Unicode support,
your Oracle client software's (SQL Developer) Unicode support,
your Java JDK/JRE's Unicode support,
your JDBC driver's Unicode support,
your other *DBC drivers' Unicode support, if there are any more in chain.
Sad thing is that the more interfaces you have between your keyboard and your Oracle database, the more likely is one of them to fiddle with your charset conversions badly.
So, let's just hope that the first two hints work for you, otherwise I can't help you (that easily).

Encoding in Oracle database

I have a problem when inserting values into my Oracle database. I have to insert French characters like à or è and when I try to insert them through an INSERT statement it will convert the character to ¿ or ?.
Is there any possibility to set the encoding of that specific script, or what can I do in this situation ?
Thank you
Usually you would set the character set when you install your database. You can, however, change it post-setup if required (Look up CSALTER). If your database needs to support multiple languages, then you should take a look at this: Supporting Multilingual Databases with Unicode
I have fixed this problem by adding an Environment Variable called NLS_LANG with the value .AL32UTF8 . This worked even though the database has as language American and territory America. The problem that I have faced here was that once I changed the NLS_LANG variable, it started to encode my characters also in the application.
Also you can try to change the encoding of the script that you are running. For example I have used ANSI encoding (you can do it by opening a script in notepad++ and from the Encoding menu, select Convert to ANSI) and it worked properly.
Thank you guys for your help :)

How does oracle (via sql/plus) determine the charset used to evaluate a sql script

I'd like to have a few details about how oracle (via sql/plus) determine the charset used to evaluate a sql script.
My database is configured like this:
select VALUE from nls_database_parameters where parameter='NLS_CHARACTERSET';
VALUE
------
WE8ISO8859P15
The problem is that I read here http://www.orafaq.com/wiki/NLS that session parameters could take precedence over database parameters.
Does it mean that database encoding is overriden by the one defined in the NLS_LANG environment variable of the user who executes the script?
Apparently, it's not possible to modify the encoding in a script via an alter session statement.
I'm asking this question since I already had a problem of corrupted characters with a production script executed by a subcontractor in India. I actually don't know if it was because he did something wrong with my file (like copy/paste in a sql gui client) or if it was because of his environment.
To summarize my actual problem, will everything be OK if
The user is configured with a charset of UTF8
My sql file is encoded in UTF8
My database is in WE8ISO8859P15
Thank's in advance for your answers.
Yes, you are correct. The Oracle Client always converts between the database characterset and the characterset of the client machine, which is determined by the NLS_LANG environment variable or the system settings.
Please note that UTF8 supports only Unicode version 3.1 and earlier. Use AL32UTF8 instead to get full Unicode support.

i am not able to see arabic letters while using pl sql developer

I am not able to see Arabic letters while using pl sql developer
In one database, its showing correctly, but when I query in another its not coming up.
Is there anything to change in settings ? if anyone knew please let me know !!!
Might be datatype on the other database in not the NVARCHAR. Please make sure that it is nvarchar datatype in the other database also.