oracle ORA-12714: 指定的国家字符集无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3329086/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ORA-12714: invalid national character set specified
提问by Khaled
I got a problem with oracle database ,i created a stored procedure and i wanted to pass an array of items' ids to this procedure to select the data according to array of items using "in" clause,the available solution to this as i found was to create a function and pass a string value with all item's ids seperated by a comma ,and this function will return a datatble with a row for each item id.this approach works fine when i try it in toad in a select statement,,but when i use it in the stored procedure i get a strange error
我遇到了 oracle 数据库的问题,我创建了一个存储过程,我想将一个项目的 id 数组传递给这个过程,以使用“in”子句根据项目数组选择数据,这是我发现的可用解决方案是创建一个函数并传递一个字符串值,所有项目的 id 用逗号分隔,这个函数将返回一个数据表,每个项目 id 一行。当我在 toad 中在 select 语句中尝试时,这种方法工作正常,,但是当我在存储过程中使用它时,我收到一个奇怪的错误
"ORA-12714: invalid national character set specified"
“ORA-12714:指定的国家字符集无效”
after searching about the reason of that error i found that it is a bug in that version of oracle according to this page and it was fixed in a 10.2.0.4 oracle patch and the exact reason is to declare a cursor for the function that returns a data table
在搜索了该错误的原因后,我发现根据此页面,这是该版本的 oracle 中的错误,并且在 10.2.0.4 的 oracle 补丁中已修复,确切原因是为返回 a 的函数声明一个游标数据表
As it is impossible to me to let the users who work on a live production environment to stop the servers to apply the update patch ,I was wondering if any Oracle expert can help me to declare a cursor and return that cursor instead of returning the table.
由于我不可能让在实时生产环境中工作的用户停止服务器以应用更新补丁,我想知道是否有任何 Oracle 专家可以帮助我声明一个游标并返回该游标而不是返回表.
my Oracle function,Thanks in Advance
我的 Oracle 功能,提前致谢
create or replace
FUNCTION SplitIDs(
v_List IN VARCHAR2)
RETURN RtnValue_Set PIPELINED
AS
SWV_List VARCHAR2(2000);
v_RtnValue Dt_RtnValue := Dt_RtnValue(NULL);
BEGIN
SWV_List := v_List;
WHILE (instr(SWV_List,',') > 0)
LOOP
FOR RetRow IN
(SELECT ltrim(rtrim(SUBSTR(SWV_List,1,instr(SWV_List,',') -1))) SelectedValue
FROM dual
)
LOOP
v_RtnValue.SelectedValue := RetRow.SelectedValue;
PIPE ROW(v_RtnValue);
END LOOP;
SWV_List := SUBSTR(SWV_List,instr(SWV_List,',')+LENGTH(','),LENGTH(SWV_List));
END LOOP;
FOR RetRow IN
(SELECT ltrim(rtrim(SWV_List)) SelectedValue FROM dual
)
LOOP
v_RtnValue.SelectedValue := RetRow.SelectedValue;
PIPE ROW(v_RtnValue);
END LOOP;
RETURN;
END;
回答by DannyS
Oracle says this about the error:
甲骨文说这个错误:
Error: ORA-12714 (ORA-12714)
错误:ORA-12714 (ORA-12714)
Text: invalid national character set specified
文本:指定的国家字符集无效
Cause: Only UTF8 and AL16UTF16 are allowed to be used as the national character set
原因:只允许使用 UTF8 和 AL16UTF16 作为国家字符集
Action: Ensure that the specified national character set is valid
行动:确保指定的国家字符集是有效的
Check your NLS_NCHAR_CHARACTERSET which is set using:
检查您使用以下方法设置的 NLS_NCHAR_CHARACTERSET:
select value from NLS_DATABASE_PARAMETERS where parameter = 'NLS_NCHAR_CHARACTERSET';
从 NLS_DATABASE_PARAMETERS 中选择值,其中参数 = 'NLS_NCHAR_CHARACTERSET';
Try using NCHAR, NVARCHAR2 or NCLOB
尝试使用 NCHAR、NVARCHAR2 或 NCLOB