我在使用带有“ODP.net”的“C#”中的 SP 时遇到问题。
执行此操作时:
List<OracleParam> param = new List<OracleParam>();
param.Add(new OracleParam("IdEstivantIn", OracleDbType.Decimal, estivant.IdEstivant, ParameterDirection.Input));
param.Add(new OracleParam("NomIn", OracleDbType.NClob, estivant.Nom, ParameterDirection.Input));
param.Add(new OracleParam("PrenomIn", OracleDbType.NClob, estivant.Prenom, ParameterDirection.Input));
param.Add(new OracleParam("FixeIn", OracleDbType.NClob, estivant.Fixe, ParameterDirection.Input));
param.Add(new OracleParam("PortableIn", OracleDbType.NClob, estivant.Portable, ParameterDirection.Input));
param.Add(new OracleParam("MailIn", OracleDbType.NClob, estivant.Mail, ParameterDirection.Input));
param.Add(new OracleParam("RueIn", OracleDbType.NClob, estivant.Rue, ParameterDirection.Input));
param.Add(new OracleParam("NumeroRueIn", OracleDbType.NClob, estivant.NumeroRue, ParameterDirection.Input));
param.Add(new OracleParam("CodePostaleIn", OracleDbType.NClob, estivant.CodePostal, ParameterDirection.Input));
param.Add(new OracleParam("VilleIn", OracleDbType.NClob, estivant.Ville, ParameterDirection.Input));
param.Add(new OracleParam("PaysIn", OracleDbType.NClob, estivant.Pays, ParameterDirection.Input));
//param.Add(new OracleParam("PaysIn", OracleDbType.RefCursor, null, ParameterDirection.ReturnValue));
con.ExecuteReturn(CommandType.StoredProcedure, "TAMARIS.PACKAGE_EST.updateEst", param);
我收到此错误:
ORA-12704: character set mismatch
ORA-06512: at "TAMARIS.PACKAGE_EST", line 94
ORA-06512: at line 1
在我的数据库中,PK 是一个数字,所有其他字段都是 NCLOBS。
我的 SP 的规格如下:
PROCEDURE updateEst (
IdEstivantIn IN number,
NomIn IN nclob ,
PrenomIn IN nclob,
FixeIn IN nclob,
PortableIn IN nclob,
MailIn IN nclob,
RueIn IN nclob,
NumeroRueIn IN nclob,
CodePostaleIn IN nclob,
VilleIn IN nclob,
PaysIn IN nclob) IS
BEGIN
对于另一个 SP,我还有另一个问题,我认为这一定是相关的。
错误如下:
ORA-06550: line 1, column 15:
PLS-00306: wrong number or types of arguments in call to 'INSERTEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
我打的电话:
param.Add(new OracleParam("Nom_in", OracleDbType.NClob, estivant.Nom, ParameterDirection.Input));
param.Add(new OracleParam("Prenom_in", OracleDbType.NClob, estivant.Prenom, ParameterDirection.Input));
param.Add(new OracleParam("Fixe_in", OracleDbType.NClob, estivant.Fixe, ParameterDirection.Input));
param.Add(new OracleParam("Portable_in", OracleDbType.NClob, estivant.Portable, ParameterDirection.Input));
param.Add(new OracleParam("Mail_in", OracleDbType.NClob, estivant.Mail, ParameterDirection.Input));
param.Add(new OracleParam("Rue_in", OracleDbType.NClob, estivant.Rue, ParameterDirection.Input));
param.Add(new OracleParam("NumeroRue_in", OracleDbType.NClob, estivant.NumeroRue, ParameterDirection.Input));
param.Add(new OracleParam("CodePostale_in", OracleDbType.NClob, estivant.CodePostal, ParameterDirection.Input));
param.Add(new OracleParam("Ville_in", OracleDbType.NClob, estivant.Ville, ParameterDirection.Input));
param.Add(new OracleParam("Pays_in", OracleDbType.NClob, estivant.Pays, ParameterDirection.Input));
param.Add(new OracleParam("", OracleDbType.Int32, null, ParameterDirection.ReturnValue));
con.ExecuteStoredReturn(CommandType.StoredProcedure, "PACKAGE_EST.insertEst", param);
我错过了什么?是因为我使用的是 NClobs 而不是 varchars 吗?
我真的不知道这里发生了什么,但我认为它一定是一些简单的错误。