そのようなエラーを見たことがない:
エラー [22P02] エラー: 整数の入力構文が無効です: ""; クエリ実行中のエラー
テーブルの作成:
Public Function PrimkCreate(ByVal myPrimkTable As String, ByVal nCon As OdbcConnection) As Integer
Dim ans As Integer
Dim cCommand As OdbcCommand = New OdbcCommand("CREATE TABLE IF NOT EXISTS " + myPrimkTable + "(" & _
"prm_id int NOT NULL, " & _
"pkni text, " & _
"pdatum text, " & _
"pdatumnaplate text, " & _
"pdanaodgode int, " & _
"puldok text, " & _
"puldokbroj text, " & _
"pdatumk text, " & _
"pvrijemek text, " & _
"pdobid int, " & _
"pdoboib text, " & _
"pnabc double precision, " & _
"purab double precision, " & _
"ppdv double precision, " & _
"ppnak double precision, " & _
"pprodc double precision, " & _
"pvrstaprimke int, " & _
"pzapisniktekst text, " & _
"prez text, " & _
"CONSTRAINT " & myPrimkTable & "_pkey PRIMARY KEY(prm_id))", nCon)
ans = cCommand.ExecuteNonQuery()
cCommand.Dispose()
Return ans
End Function
更新コード:
Public Function update_LPrimk(ByRef primk As Integer, ByVal mCon As OdbcConnection) As Integer
Dim retval As Integer
Dim uCmd As OdbcCommand = New OdbcCommand("UPDATE " & myPrimkTable & " SET " & _
"prm_id=" & primk & ", " & _
"pkni='" & prm.pKni & "', " & _
"pdatum='" & prm.pDatum & "', " & _
"pdatumnaplate='" & prm.pDatumNaplate & "', " & _
"pdanaodgode=" & prm.pDanaodgode & ", " & _
"puldok='" & prm.pUlDok & "', " & _
"puldokbroj='" & prm.pUlDokBroj & "', " & _
"pdatumk='" & prm.pDatumk & "', " & _
"pvrijemek='" & prm.pVrijemek & "', " & _
"pdobid='" & prm.pDobID & "', " & _
"pdoboib='" & prm.pDobOib & "', " & _
"pnabc='" & Replace(prm.pNabc.ToString, ",", ".") & "', " & _
"purab='" & Replace(prm.pURab.ToString, ",", ".") & "', " & _
"ppdv='" & Replace(prm.pPdv.ToString, ",", ".") & "', " & _
"ppnak='" & Replace(prm.pPnak.ToString, ",", ".") & "', " & _
"pprodc='" & Replace(prm.pProdc.ToString, ",", ".") & "', " & _
"pvrstaprimke=" & prm.pVrstaPrimke & ", " & _
"pzapisniktekst='" & prm.pZapisnikTekst & "', " & _
"prez='" & prm.pRez & "' " & _
"WHERE prm_id=" + primk.ToString, mCon)
retval = uCmd.ExecuteNonQuery()
uCmd.Dispose()
Return retval
End Function
クエリは次のようになります。
UPDATE primke SET prm_id=1, pkni='U', pdatum='07.01.2013', pdatumnaplate='10.01.2013',
pdanaodgode=3, puldok='ghkzug gugug', puldokbroj='jkhk', pdatumk='', pvrijemek='',
pdobid='', pdoboib='', pnabc='0', purab='0', ppdv='0', ppnak='0', pprodc='0',
pvrstaprimke=0, pzapisniktekst='', prez='' WHERE prm_id=1
同様のコマンドを実行するテーブルがたくさんありますが、そのようなエラーは見たことがありません。
何が問題なのですか?