// If there is a primary key defined, include it in the create statement
for (i = j = 0; i < noCols; i++)
{
if (colDefs[i].KeyField)
{
j++;
break;
}
}
if (j && (pDb->Dbms() != dbmsDBASE)
&& (pDb->Dbms() != dbmsXBASE_SEQUITER)
) // Found a keyfield
{
switch (pDb->Dbms())
{
case dbmsACCESS:
case dbmsINFORMIX:
case dbmsSYBASE_ASA:
case dbmsSYBASE_ASE:
case dbmsMY_SQL:
{
// MySQL goes out on this one. We also declare the relevant key NON NULL above
sqlStmt += wxT(",PRIMARY KEY (");
break;
}
default:
{
sqlStmt += wxT(",CONSTRAINT ");
// DB2 is limited to 18 characters for index names
if (pDb->Dbms() == dbmsDB2)
{
wxASSERT_MSG((tableName && wxStrlen(tableName) <= 13), wxT("DB2 table/index names must be no longer than 13 characters in length.\n\nTruncating table name to 13 characters."));