From 3594e310569fdd7316f47c2bfe9aa55844569835 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 4 May 2022 09:18:09 +0800 Subject: [PATCH] Update Oracle --- Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs index 002bc7b91..759266852 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs @@ -122,6 +122,10 @@ namespace SqlSugar var isVarchar = this.Context.IsVarchar(); foreach (var parameter in parameters) { + if (parameter.ParameterName.ToLower().IsIn("@user", "@level", "@key", ":user", ":level", ":key")) + { + Check.ExceptionEasy($"{parameter.ParameterName.Replace(":","@")} key word", $"参数名{parameter.ParameterName.Replace(":", "@")}是关键字 ,在ORACLE中例如 {parameter.ParameterName.Replace(":", "@")} 无法定义成参数 ,你可以用AOP替换参数名"); + } if (parameter.Value == null) parameter.Value = DBNull.Value; var sqlParameter = new OracleParameter(); sqlParameter.Size = parameter.Size == -1 ? 0 : parameter.Size;