drop the table and recreate it. It's a known issue with sqlite. http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#SQLite
On Thursday, May 29, 2014 9:34:28 PM UTC+2, Tom Russell wrote: > > I am getting the following error when inserting a new record for a table I > have. I cannot seem to pinpoint what the cause is at this time. > > The error is: > > Traceback (most recent call last): > File > "/home/tsrdatatech/web2py/applications/ttheorydataextractor/controllers/appadmin.py", > line 270, in select > *fields, limitby=(start, stop)) > File "/home/tsrdatatech/web2py/gluon/dal.py", line 10525, in select > return adapter.select(self.query,fields,attributes) > File "/home/tsrdatatech/web2py/gluon/dal.py", line 2458, in select > return super(SQLiteAdapter, self).select(query, fields, attributes) > File "/home/tsrdatatech/web2py/gluon/dal.py", line 1882, in select > return self._select_aux(sql,fields,attributes) > File "/home/tsrdatatech/web2py/gluon/dal.py", line 1847, in _select_aux > self.execute(sql) > File "/home/tsrdatatech/web2py/gluon/dal.py", line 1969, in execute > return self.log_execute(*a, **b) > File "/home/tsrdatatech/web2py/gluon/dal.py", line 1963, in log_execute > ret = self.cursor.execute(command, *a[1:], **b) > File "/usr/lib/python2.7/sqlite3/dbapi2.py", line 63, in convert_date > return datetime.date(*map(int, val.split("-"))) > ValueError: invalid literal for int() with base 10: '12/02/2013' > > > And my table looks like: > > db.define_table("daily_data", > Field("startdate","date",requires=IS_DATE(), label="Date", > readable=True, writable=False), > Field("vol_total","double", label="Vol Total", readable=True, > writable=False), > Field("wsj_date","string", label="WSJ Date", readable=True, > writable=False), > Field("trin","double", label="TRIN", readable=True, writable=False), > Field("gold","double", readable=True, writable=False), > Field("vix","double", label="VIX", readable=False, writable=False), > Field("advances","double", readable=True, writable=False), > Field("declines","double", readable=True, writable=False), > Field("adv_vol","double", readable=True, writable=False), > Field("dec_vol","double", readable=True, writable=False), > Field("sp_hi","double", readable=True, writable=False), > Field("sp_low","double", readable=True, writable=False), > Field("sp_close","double", readable=True, writable=False), > Field("spy","double", label="SPY", readable=False, writable=False), > Field("csj","double", label="CSJ", readable=False, writable=False), > Field("bnd","double", label="BND", readable=False, writable=False), > Field("cwb","double", label="CWB", readable=False, writable=False), > Field("bond","double", label="BOND", readable=False, writable=False), > Field("hys","double", label="HYS", readable=False, writable=False), > Field("flot","double", label="FLOT", readable=False, writable=False), > Field("hyg","double", label="HYG", readable=False, writable=False), > Field("bkln","double", label="BKLN", readable=False, writable=False), > Field("emb","double", label="EMB", readable=False, writable=False), > Field("efa","double", label="EFA", readable=False, writable=False), > Field("fex","double", label="FEX", readable=False, writable=False), > Field("mdy","double", label="MDY", readable=False, writable=False), > Field("fnx","double", label="FNX", readable=False, writable=False), > Field("vti","double", label="VTI", readable=False, writable=False), > Field("iwd","double", label="IWD", readable=False, writable=False), > Field("fta","double", label="FTA", readable=False, writable=False), > Field("iwm","double", label="IWM", readable=False, writable=False), > Field("dvy","double", label="DVY", readable=False, writable=False), > Field("iyr","double", label="IYR", readable=False, writable=False), > Field("ijr","double", label="IJR", readable=False, writable=False), > Field("tlt","double", label="TLT", readable=False, writable=False), > Field("ief","double", label="IEF", readable=False, writable=False), > Field("vustx","double", label="VUSTX", readable=False, > writable=False), > Field("fagix","double", label="FAGIX", readable=False, > writable=False), > Field("qqq","double", label="QQQ", readable=False, writable=False), > ) > > I know the error refers to a date and actually I had wsj_date as a date > field but changed it to a string since I really did not need the date > requirement for it. > > Any suggestions? > > Thanks. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.