Hello guys,

I have this table on my datbase a blob where I have a row
in which I have a BLOB data type.
I need to update the rows with a image rendering graphic
<<snipp code>>
... SQL statement


CString strSQL;
strSQL.Format("update table_process_object "
"set "
"tbl_diagram_len = %d, "
"tbl_diagram_lng = ? "
"where tblo_id = %d",
m_nDiagramImageLength, m_ntblID);

.. code continues here


if ((rc = SQLBindParameter (hstmt, // bpo_diagram_lng
1,
SQL_PARAM_INPUT,
SQL_C_BINARY,
SQL_LONGVARBINARY,
0,
0,
(SQLPOINTER) 2,
0,
(SQLINTEGER *)&ll2)) != SQL_SUCCESS)
::AfxThrowDBException (rc, pDatabase, &hstmt);
.....
..... code continues here
.....
for(rc = SQLParamData(hstmt, &pBindAddress) ;
rc == SQL_NEED_DATA ;
rc = SQLParamData(hstmt, &pBindAddress))
{
if(pBindAddress == (SQLPOINTER) 2)
{
SQLINTEGER nLen_or_Ind;
if (m_nDiagramImageLength == 0)
nLen_or_Ind = SQL_NULL_DATA;
else
nLen_or_Ind = m_nDiagramImageLength;
rc = SQLPutData(hstmt, m_pDiagramImage, nLen_or_Ind) ;
}
else
break;
if(rc != SQL_SUCCESS && rc != SQL_NEED_DATA)
::AfxThrowDBException (rc, pDatabase, &hstmt);
<< ends here>>

on the first pass of the for statement the stmt goes fine, in the
second iteration the application crashes with 000005 access violation
error.
if my binding incorrect or what is the issue here ?
is there any issues with UPDATE statements and the BLOB data type
on DB2 when using MFCC++ and the ODBC IBM/DB2 driver?

I am using DB2 v7.1(FP3) WITH UTF-8 ON MY DATABASE

thank you