Unicode in Oracle Stored Procedure
create or replace PROCEDURE SP_GETINCOMEENTRY
( idec IN NUMBER := 1
, p_IncomeID tbl_income.incomeid%type := 1
, P_Data Out Sys_Refcursor
, P_Fromdate tbl_acc_income.Dateeng%Type := null
, P_ToDate tbl_acc_income.Entrydate%type := null
)
is
begin
if idec=1
then
open p_DATA
fo开发者_如何学Gor
SELECT INCOMEID as ID
, INCOMENAME as Name
FROM TBL_INCOME
order
by p_IncomeID
;
else
if Idec=2
then
OPEN P_DATA
FOR
Select Incomeid As id
, Billno As "¿¿¿ ¿¿"
, Relatedperson As "AccountHolder"
, Incomesourid As "IncomeID"
, Dateeng As"EnglishDate"
, Remarks As "Remarks"
, Amount As "Amount"
, Username As "UserName"
, Entrydate As "EntryDate"
from Tbl_Acc_Income
where Tbl_Acc_Income.dateeng between P_Fromdate and P_Todate
order
by INCOMEID
;
end if;
end if;
end;
BillNo As "¿¿¿ ¿¿"
, is unicode in NEPALI but oracle
is not returning "¿¿¿ ¿¿" when tried to display in DataGrid
Header in C#
So please Help.
Oracle supports the use of Unicode in column names. And the construct listed is known to work. However, there are several places where things go wrong. Living in the Netherlands and working with many foreign languages in Oracle, it was always a pleasure to encounter yet another bug in application or Oracle kernel due to use of Unicode. In Oracle 11.2 most Unicode problems finally have been resolved.
Please check the following possible causes:
Database UNICODE?
Is your database AL32UTF? Use select value from v$nls_parameters where name='NLS_CHARACTERSET'
Undesired translation between client and server
This is your probably cause.
Is your client correctly configured and does it use the settings needed?
Since C# supports almost the same Unicode as Oracle, always use something like 'DUTCH_THE NETHERLANDS.AL32UTF8' as your client's character set, for instance using NLS_LANG. More instructions can be found in manual of one of our software packages.
Otherwise Oracle will convert characters out of the value range to something like '?'. Please note that character conversion ONLY takes place when the charactersets on both sides differ. If they are both incorrect but identical, Oracle will not notice and just transfer all characters binary without conversion.
Please update your question to reflect what it is returning instead of the upside down question marks.
This conversion occurs with all data, column names or column contents.
Can you update your question whether column contents outside of US7ASCII range is display also incorrectly or not?
Client Code
Large parts of client software have not been tested with UNICODE characters. The easiest way to get a SQL application crashing is often to introduce mixed case column names or UNICODE column names. Since your client code is C# and you are probably using ODP.NET for connection, that should not be a problem in your case.
For now, please check that you are running ODP.NET.
Distributed databases
Oracle distributed databases can also introduce extra problems in addition to client/server character set conversion. There are some bugs involved. Please update question if you use distributed databases.
精彩评论