Notice
Recent Posts
Recent Comments
Link
목록the current statement uses 1 and there are 3 supplied (1)
JY Tech
[파이썬,sqlite] incorrect number of bindings supplied. the current statement uses 1 and there are 3 supplied
cur.execute("SELECT tool_Name FROM Tool WHERE tool_Name=?",(toolName,)) 파이썬과 sqlite를 활용한 프로그램을 만들면서 아래와 같은 코드를 작성했는데 incorrect number of bindings supplied. the current statement uses 1 and there are 3 supplied 이런 오류가 발생했다. 구글링을 해 보니 해결법은 생각보다 간단했다. cur.execute는 튜플을 전달해야 되는데 (toolName)의 형태로 값만 전달해서 그렇단다(데이터 바인딩 오류). 튜플로 값을 전달하기 위해 , 만 추가해 주면 된다 따라서 코드를 다음과 같이 수정하면 된다. cur.execute("SELECT tool_Nam..
Programming/Error Solution
2023. 4. 21. 14:16