我使用的是oracle 11版本的數據庫,但我使用EF Core 2.1,在使用linq進行分頁會生成Oracle 12語法的SQL,在Oracle 11下會運行報錯。sql
optionsBuilder.UseOracle(connectionString,p => p.UseOracleSQLCompatibility("11"));
SELECT "p"."KEYID" FROM "HD_FORM" "p" WHERE "p"."EAREA" IS NULL OFFSET :p_0 ROWS FETCH NEXT :p_1 ROWS ONLY
Select K0 "KEYID" from( select "m2".*, rownum r2 from ( SELECT "p"."KEYID" K0 FROM "HD_FORM" "p" WHERE ("p"."EAREA" IS NULL ) ) "m2" ) "m1" where r2 > :p_0 and r2 <= (:p_0 + :p_1)
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Debug;
public static readonly LoggerFactory MyLoggerFactory = new LoggerFactory(new[] { new DebugLoggerProvider((category, level) => category == DbLoggerCategory.Database.Command.Name && level >= LogLevel.Information) });
optionsBuilder.UseLoggerFactory(MyLoggerFactory);