#endif
#ifdef DBDEBUG_CONSOLE
- #include "iostream.h"
+#if wxUSE_IOSTREAMH
+ #include <iostream.h>
+#else
+ #include <iostream>
+#endif
#include "wx/ioswrap.h"
#endif
bool firstColumn = TRUE;
pSqlStmt.Printf(wxT("UPDATE %s SET "),
- pDb->SQLTableName(tableName.Upper().c_str()).c_str());
+ pDb->SQLTableName(tableName.c_str()).c_str());
// Append a list of columns to be updated
int i;
break;
}
// For varchars, append the size of the string
- if (colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR)// ||
+ if (colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR &&
+ (pDb->Dbms() != dbmsMY_SQL || pDb->GetTypeInfVarchar().TypeName != "text"))// ||
// colDefs[i].DbDataType == DB_DATA_TYPE_BLOB)
{
wxString s;
if (j++) // Multi part key, comma separate names
sqlStmt += wxT(",");
sqlStmt += pDb->SQLColumnName(colDefs[i].ColName);
-// sqlStmt += colDefs[i].ColName;
+
+ if (pDb->Dbms() == dbmsMY_SQL &&
+ colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR)
+ {
+ wxString s;
+ s.Printf(wxT("(%d)"), colDefs[i].SzDataObj);
+ sqlStmt += s;
+ }
}
}
sqlStmt += wxT(")");
pDb->Dbms() == dbmsDBASE /*|| Paradox needs this syntax too when we add support*/)
sqlStmt.Printf(wxT("DROP INDEX %s ON %s"),
pDb->SQLTableName(idxName.c_str()).c_str(),
- pDb->SQLTableName(tableName.c_str().c_str()));
+ pDb->SQLTableName(tableName.c_str()).c_str());
else if ((pDb->Dbms() == dbmsMS_SQL_SERVER) ||
(pDb->Dbms() == dbmsSYBASE_ASE))
sqlStmt.Printf(wxT("DROP INDEX %s.%s"),