问题
data_var := dateadd(day,1,data_var);
I'm trying this to increment one day to data_var but I keep getting this error 'identifier 'dateadd' must be declared'. I searched all around and found nothing to help me deal with this issue. Help?
回答1:
By your mention of SQL Developer I'm going to assume you're using Oracle. If this is the case then the error makes complete sense as the function DATEADD()
does not exist. It's always worth searching the documentation if you have a problem; in this instance you would have found nothing, which should have given you a clue.
To add a day to a date in Oracle simply add one to the date, i.e.:
date_var := date_var + 1;
For more information see the documentation on datetime and interval arithmetic.
来源:https://stackoverflow.com/questions/20019992/incrementing-one-day-to-date-in-sql-developer