sqlite3.IntegrityError: UNIQUE constraint failed: usersoil_Rur.SNAM

411 views
Skip to first unread message

Henrike Vogelsang

unread,
Jul 21, 2022, 10:48:54 AM7/21/22
to QSWAT+
Dear all, 

I am having trouble using a users oil table in the HRU creation. I get the following error message: 

Could not write to table usersoil_Rur in database C:/Users/Henrike Vogelsang/Desktop/Rur Catchment Watershed\Rur Catchment Watershed.sqlite from file C:/Users/Henrike Vogelsang/Desktop/Rur Catchment Watershed/Data_RurCatchment/Soil/usersoil_Rur.csv: Traceback (most recent call last):
  File "C:\Users/Henrike Vogelsang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_9\QSWATPlus\DBUtils.py", line 2667, in importCsv
    cursor.execute(sql, tuple(line))
sqlite3.IntegrityError: UNIQUE constraint failed: usersoil_Rur.SNAM

When I add a MUID column to the users oil table, I get another error which is the following: 

Could not write to table usersoil_Rur in database C:/Users/Henrike Vogelsang/Desktop/Rur Catchment Watershed\Rur Catchment Watershed.sqlite from file C:/Users/Henrike Vogelsang/Desktop/Rur Catchment Watershed/Data_RurCatchment/Soil/usersoil_Rur.csv: Traceback (most recent call last):
  File "C:\Users/Henrike Vogelsang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_9\QSWATPlus\DBUtils.py", line 2667, in importCsv
    cursor.execute(sql, tuple(line))
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 152, and there are 153 supplied.

I don't know what else to try and would really appreciate your help!

Thank you!

Henrike Vogelsang

unread,
Jul 21, 2022, 10:50:15 AM7/21/22
to QSWAT+
FIY I am using QGIS 3.22. and QSWAT+ 2.2.5 on a Windows 10 Computer. 

Thanks!

Reply all
Reply to author
Forward
0 new messages