Skip to content

Commit 9a7761b

Browse files
authored
Register localtimestamp as current_timestamp in Oracle9iDialect (#3707)
1 parent e851310 commit 9a7761b

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/NHibernate/Dialect/Oracle9iDialect.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,10 @@ namespace NHibernate.Dialect
77
{
88
public class Oracle9iDialect : Oracle8iDialect
99
{
10-
public override string CurrentTimestampSelectString
11-
{
12-
get { return "select systimestamp from dual"; }
13-
}
10+
public override string CurrentTimestampSelectString =>
11+
$"select {CurrentTimestampSQLFunctionName} from dual";
1412

15-
public override string CurrentTimestampSQLFunctionName
16-
{
17-
get
18-
{
19-
// the standard SQL function name is current_timestamp...
20-
return "current_timestamp";
21-
}
22-
}
13+
public override string CurrentTimestampSQLFunctionName => "localtimestamp";
2314

2415
// Current_timestamp is a timestamp with time zone, so it can always be converted back to UTC.
2516
/// <inheritdoc />
@@ -46,6 +37,9 @@ protected override void RegisterFunctions()
4637
{
4738
base.RegisterFunctions();
4839

40+
RegisterFunction(
41+
"current_timestamp",
42+
new NoArgSQLFunction("localtimestamp", NHibernateUtil.LocalDateTime, false));
4943
RegisterFunction(
5044
"current_utctimestamp",
5145
new SQLFunctionTemplate(NHibernateUtil.UtcDateTime, "SYS_EXTRACT_UTC(current_timestamp)"));

0 commit comments

Comments
 (0)