@@ -170,6 +170,7 @@ protected virtual void RegisterFunctions()
170
170
RegisterFunction ( "substring" , new EmulatedLengthSubstringFunction ( ) ) ;
171
171
RegisterFunction ( "str" , new SQLFunctionTemplate ( NHibernateUtil . String , "cast(?1 as nvarchar)" ) ) ;
172
172
173
+ RegisterFunction ( "current_timestamp" , new NoArgSQLFunction ( "getdate" , NHibernateUtil . DateTime , true ) ) ;
173
174
RegisterFunction ( "date" , new SQLFunctionTemplate ( NHibernateUtil . DateTime , "dateadd(dd, 0, datediff(dd, 0, ?1))" ) ) ;
174
175
RegisterFunction ( "second" , new SQLFunctionTemplate ( NHibernateUtil . Int32 , "datepart(second, ?1)" ) ) ;
175
176
RegisterFunction ( "minute" , new SQLFunctionTemplate ( NHibernateUtil . Int32 , "datepart(minute, ?1)" ) ) ;
@@ -187,10 +188,15 @@ protected virtual void RegisterFunctions()
187
188
RegisterFunction ( "lower" , new StandardSQLFunction ( "lower" ) ) ;
188
189
189
190
RegisterFunction ( "trim" , new AnsiTrimEmulationFunction ( ) ) ;
191
+ RegisterFunction ( "iif" , new SQLFunctionTemplate ( null , "case when ?1 then ?2 else ?3 end" ) ) ;
190
192
191
193
RegisterFunction ( "concat" , new VarArgsSQLFunction ( NHibernateUtil . String , "(" , "+" , ")" ) ) ;
194
+ RegisterFunction ( "mod" , new SQLFunctionTemplate ( NHibernateUtil . Int32 , "((?1) % (?2))" ) ) ;
192
195
193
196
RegisterFunction ( "round" , new StandardSQLFunction ( "round" ) ) ;
197
+
198
+ RegisterFunction ( "bit_length" , new SQLFunctionTemplate ( NHibernateUtil . Int32 , "datalength(?1) * 8" ) ) ;
199
+ RegisterFunction ( "extract" , new SQLFunctionTemplate ( NHibernateUtil . Int32 , "datepart(?1, ?3)" ) ) ;
194
200
}
195
201
196
202
protected virtual void RegisterDefaultProperties ( )
0 commit comments