Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/NHibernate/Dialect/Oracle9iDialect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,10 @@ namespace NHibernate.Dialect
{
public class Oracle9iDialect : Oracle8iDialect
{
public override string CurrentTimestampSelectString
{
get { return "select systimestamp from dual"; }
}
public override string CurrentTimestampSelectString =>
$"select {CurrentTimestampSQLFunctionName} from dual";

public override string CurrentTimestampSQLFunctionName
{
get
{
// the standard SQL function name is current_timestamp...
return "current_timestamp";
}
}
public override string CurrentTimestampSQLFunctionName => "localtimestamp";

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

RegisterFunction(
"current_timestamp",
new NoArgSQLFunction("localtimestamp", NHibernateUtil.LocalDateTime, false));
RegisterFunction(
"current_utctimestamp",
new SQLFunctionTemplate(NHibernateUtil.UtcDateTime, "SYS_EXTRACT_UTC(current_timestamp)"));
Expand Down
Loading