SqlExp: CURRENT_DATE, CURRENT_TIMESTAMP support

git-svn-id: svn://ultimatepp.org/upp/trunk@6399 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-10-06 17:55:57 +00:00
parent 88e2d28532
commit 95e91e4428
2 changed files with 13 additions and 0 deletions

View file

@ -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);
}

View file

@ -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);