More BLOB fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2004-05-13 01:56:18 +00:00
parent dcbb88f02a
commit c9b6d7964d

View File

@@ -442,9 +442,7 @@ void wxDbTable::setCbValueForColumn(int columnIndex)
if (colDefs[columnIndex].Null) if (colDefs[columnIndex].Null)
colDefs[columnIndex].CbValue = SQL_NULL_DATA; colDefs[columnIndex].CbValue = SQL_NULL_DATA;
else else
if (colDefs[columnIndex].SqlCtype == SQL_C_BINARY) if (colDefs[columnIndex].SqlCtype == SQL_C_CHAR)
colDefs[columnIndex].CbValue = 0;
else if (colDefs[columnIndex].SqlCtype == SQL_C_CHAR)
colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(0); colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(0);
else else
colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(colDefs[columnIndex].SzDataObj); colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(colDefs[columnIndex].SzDataObj);
@@ -510,7 +508,7 @@ bool wxDbTable::bindParams(bool forUpdate)
break; break;
case DB_DATA_TYPE_BLOB: case DB_DATA_TYPE_BLOB:
fSqlType = pDb->GetTypeInfBlob().FsqlType; fSqlType = pDb->GetTypeInfBlob().FsqlType;
precision = -1; precision = colDefs[i].SzDataObj;
scale = 0; scale = 0;
break; break;
} }
@@ -530,7 +528,7 @@ bool wxDbTable::bindParams(bool forUpdate)
{ {
if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype, if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj,
precision+1,&colDefs[i].CbValue) != SQL_SUCCESS) precision+1, &colDefs[i].CbValue) != SQL_SUCCESS)
{ {
return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
} }
@@ -692,6 +690,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt)
break; break;
} }
} }
retcode = SQLParamData(hstmtUpdate, &pParmID);
} }
if (retcode == SQL_SUCCESS || if (retcode == SQL_SUCCESS ||
retcode == SQL_NO_DATA_FOUND || retcode == SQL_NO_DATA_FOUND ||
@@ -867,7 +866,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
} }
else else
insertable= FALSE; insertable = FALSE;
} }
// Completed successfully // Completed successfully
@@ -1946,6 +1945,7 @@ int wxDbTable::Insert(void)
break; break;
} }
} }
retcode = SQLParamData(hstmtInsert, &pParmID);
} }
} }