agrc / ugs-db

Database seeder for UGS data
2 stars 1 forks source link

Stations rebased with results #23

Closed steveoh closed 9 years ago

steveoh commented 9 years ago

closes #22

the error i'm left with

insert into Results (AnalysisDate, AnalytMeth, AnalytMethId, AutoQual, CAS_Reg, Chrg, DataSource, DetectCond, I dNum, LabComments, LabName, Lat_Y, LimitType, Lon_X, MDL, MDLUnit, MethodDescript, OrgId, OrgName, Param, Param Group, ProjectId, QualCode, ResultComment, ResultStatus, ResultValue, SampComment, SampDepth, SampDepthRef, Sam pDepthU, SampEquip, SampFrac, SampleDate, SampleTime, SampleId, SampMedia, SampMeth, SampMethName, SampType, St ationId, Unit, USGSPCode) values (Cast('2014-02-13' as datetime),Cast('2015-08-13' as datetime),Cast('0353-08-1 3' as datetime),Null,Null,Null,Null,Cast('2015-08-13' as datetime),Null,Cast('2015-08-13' as datetime),Cast('20 15-08-13' as datetime),Null,Null,Null,0.01,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,0.31,Null,Null,Nul l,Null,Null,Null,Cast('2014-02-11' as datetime),Cast('2015-08-13' as datetime),Null,Cast('2015-08-13' as dateti me),Null,Null,Null,Null,Null,Cast('2015-08-13' as datetime))
Traceback (most recent call last):
File "C:\Python27\ArcGISx6410.3\Lib\runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "C:\Python27\ArcGISx6410.3\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Projects\GitHub\ugs-db\src\dbseedermain.py", line 41, in
sys.exit(main())
File "C:\Projects\GitHub\ugs-db\src\dbseedermain.py", line 35, in main
return seeder.seed(**params)
File "dbseeder\dbseeder.py", line 64, in seed
seeder.seed()
File "dbseeder\programs.py", line 217, in seed
self._insert_rows(rows, self.sql['result_insert'])
File "dbseeder\programs.py", line 329, in _insert_rows
raise e
pyodbc.DataError: ('22007', '[22007] [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. (242) (SQLExecDirectW); [01000] [Microsof t][ODBC SQL Server Driver][SQL Server]The statement has been terminated. (3621)')