diff --git a/uppsrc/Sql/SqlVal.cpp b/uppsrc/Sql/SqlVal.cpp index 7d317db89..e6a06b8fd 100644 --- a/uppsrc/Sql/SqlVal.cpp +++ b/uppsrc/Sql/SqlVal.cpp @@ -374,6 +374,16 @@ SqlVal NextDay(const SqlVal& date) {//TODO Dialect! return SqlFunc("next_day", date); } +SqlVal SqlCurrentDate() { + return SqlVal(SqlCase(SQLITE3, "date('now')") + ("current_date"), SqlVal::HIGH); +} + +SqlVal SqlCurrentTime() { + return SqlVal(SqlCase(SQLITE3, "time('now')") + ("current_timestamp"), SqlVal::HIGH); +} + SqlVal Cast(const char* type, const SqlId& a) { return SqlFunc(type, a); } diff --git a/uppsrc/Sql/Sqlexp.h b/uppsrc/Sql/Sqlexp.h index 114ddfcb7..36aa6c31d 100644 --- a/uppsrc/Sql/Sqlexp.h +++ b/uppsrc/Sql/Sqlexp.h @@ -285,6 +285,9 @@ SqlVal LastDay(const SqlVal& date); SqlVal MonthsBetween(const SqlVal& date1, const SqlVal& date2); SqlVal NextDay(const SqlVal& date); +SqlVal SqlCurrentDate(); +SqlVal SqlCurrentTime(); + SqlVal Cast(const char* type, const SqlId& a); SqlVal SqlNvl(const SqlVal& a);