I am new to the concept so be gentle
I am attempting to put data into a table.
I have been able to successfully read from the table, so I know connectivity is good, etc.
#I prepare the statement…
set insert “INSERT INTO tblFunction VALUES (?, ?, ?, ?, ?, ?, ?)”
odbc SQLPrepare $hstmt1 $insert SQL_NTS
#bind the parameters.
odbc SQLBindParameter $hstmt1 0 SQL_PARAM_INPUT SQL_C_CHAR SQL_CHAR 15 0 tblPtNo 15 NULL
odbc SQLBindParameter $hstmt1 1 SQL_PARAM_INPUT SQL_C_CHAR SQL_CHAR 8 0 tblMsgDt 8 NULL
odbc SQLBindParameter $hstmt1 2 SQL_PARAM_INPUT SQL_C_CHAR SQL_CHAR 8 0 tblMsgTm 8 NULL
odbc SQLBindParameter $hstmt1 3 SQL_PARAM_INPUT SQL_C_CHAR SQL_CHAR 15 0 tblMsgConId 15 NULL
odbc SQLBindParameter $hstmt1 4 SQL_PARAM_INPUT SQL_C_CHAR SQL_CHAR 15 0 tblOperatorId 15 NULL
odbc SQLBindParameter $hstmt1 5 SQL_PARAM_INPUT SQL_C_CHAR SQL_CHAR 8 0 tblUpdateDt 8 NULL
odbc SQLBindParameter $hstmt1 6 SQL_PARAM_INPUT SQL_C_CHAR SQL_CHAR 8 0 tblUpdateTm 8 NULL
#set the values
set tblPtNo $msgPtNo
set tblMsgDt $msgDate
set tblMsgTm $msgTime
set tblMsgConId $msgConId
set tblOperatorId $msgOperatorId
set tblUpdateDt $msgUpdateDt
set tblUpdateTm $msgUpdateTm
#and execute the statement
set rVal [odbc SQLExecute $hstmt1]
echo $rVal
#and go grab my error
if { [cequal $rVal SQL_ERROR] } {
odbc SQLError $henv $hdbc $hstmt1 state local errorMsg 200 sz
echo “ERROR: unable to update table: State = ‘$state’, Msg = ‘$errorMsg'”
}
The error is the following:
state=07002
Msg= COUNT field incorrect
I am hopeful that someone will look at this, shake their head, and provide a simple explanation to the err of my ways
Thanks,