cschnaars / FEC-Scraper-Toolbox

Python tools to scrape, load and manage campaign finance data housed on the Federal Election Commission website
22 stars 6 forks source link

Getting 'Arithmetic overflow' Exception! #3

Closed ahmedmohiduet closed 6 years ago

ahmedmohiduet commented 8 years ago

I'm getting exception in my parse_reports.py: D:\FEC-Scraper\FEC-Scraper-Toolbox>python parse_reports.py Traceback (most recent call last): File "parse_reports.py", line 4490, in sqlresult = load_rpt_hdrs(rpttype, imageid, rpthdrdata, filehdrdata, outputhdrs[rpttype], DBCONNSTR) File "parse_reports.py", line 430, in load_rpt_hdrs cursor.execute(sql) pyodbc.DataError: ('22003', '[22003] [Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow err or converting IDENTITY to data type smallint. (8115) (SQLExecDirectW); [01000] [Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow occurred. (3606)')

Am I missing something?

Nick1211 commented 8 years ago

I got the same error information, was it solved now? And may I know how to fix the problem ?

cschnaars commented 8 years ago

My best guess is that one of your lookup tables, for some reason, has 32,767 rows in it and can't accept another row because the data type of your IDENTITY column is smallint. The easiest thing to check first is make sure the data type of the ImageID field in the Form1 table is set to int rather than smallint.

If that data type is correct, then start going through these lookup tables to see if any are "full":