A couple more 'int' to UWORD conversions
Fixed ::CreateTable() syntax problem with Sybase reported by Paul Gammans git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1399,16 +1399,23 @@ bool wxDbTable::CreateTable(bool attemptDrop)
|
|||||||
}
|
}
|
||||||
if (j && pDb->Dbms() != dbmsDBASE) // Found a keyfield
|
if (j && pDb->Dbms() != dbmsDBASE) // Found a keyfield
|
||||||
{
|
{
|
||||||
if (pDb->Dbms() != dbmsMY_SQL)
|
switch (pDb->Dbms())
|
||||||
{
|
{
|
||||||
sqlStmt += wxT(",CONSTRAINT ");
|
case dbmsSYBASE_ASA:
|
||||||
sqlStmt += tableName;
|
case dbmsSYBASE_ASE:
|
||||||
sqlStmt += wxT("_PIDX PRIMARY KEY (");
|
case dbmsMY_SQL:
|
||||||
}
|
{
|
||||||
else
|
/* MySQL goes out on this one. We also declare the relevant key NON NULL above */
|
||||||
{
|
sqlStmt += wxT(",PRIMARY KEY (");
|
||||||
/* MySQL goes out on this one. We also declare the relevant key NON NULL above */
|
break;
|
||||||
sqlStmt += wxT(", PRIMARY KEY (");
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
sqlStmt += wxT(",CONSTRAINT ");
|
||||||
|
sqlStmt += tableName;
|
||||||
|
sqlStmt += wxT("_PIDX PRIMARY KEY (");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// List column name(s) of column(s) comprising the primary key
|
// List column name(s) of column(s) comprising the primary key
|
||||||
@@ -1422,6 +1429,14 @@ bool wxDbTable::CreateTable(bool attemptDrop)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sqlStmt += wxT(")");
|
sqlStmt += wxT(")");
|
||||||
|
|
||||||
|
if (pDb->Dbms() == dbmsSYBASE_ASA ||
|
||||||
|
pDb->Dbms() == dbmsSYBASE_ASE)
|
||||||
|
{
|
||||||
|
sqlStmt += wxT(" CONSTRAINT ");
|
||||||
|
sqlStmt += tableName;
|
||||||
|
sqlStmt += wxT("_PIDX");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Append the closing parentheses for the create table statement
|
// Append the closing parentheses for the create table statement
|
||||||
sqlStmt += wxT(")");
|
sqlStmt += wxT(")");
|
||||||
@@ -1504,7 +1519,8 @@ bool wxDbTable::DropTable()
|
|||||||
|
|
||||||
|
|
||||||
/********** wxDbTable::CreateIndex() **********/
|
/********** wxDbTable::CreateIndex() **********/
|
||||||
bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, int noIdxCols, wxDbIdxDef *pIdxDefs, bool attemptDrop)
|
bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCols,
|
||||||
|
wxDbIdxDef *pIdxDefs, bool attemptDrop)
|
||||||
{
|
{
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
|
|
||||||
@@ -2040,7 +2056,7 @@ bool wxDbTable::SetQueryTimeout(UDWORD nSeconds)
|
|||||||
|
|
||||||
|
|
||||||
/********** wxDbTable::SetColDefs() **********/
|
/********** wxDbTable::SetColDefs() **********/
|
||||||
void wxDbTable::SetColDefs(int index, const wxString &fieldName, int dataType, void *pData,
|
void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType, void *pData,
|
||||||
SWORD cType, int size, bool keyField, bool upd,
|
SWORD cType, int size, bool keyField, bool upd,
|
||||||
bool insAllow, bool derivedCol)
|
bool insAllow, bool derivedCol)
|
||||||
{
|
{
|
||||||
@@ -2079,14 +2095,14 @@ void wxDbTable::SetColDefs(int index, const wxString &fieldName, int dataType, v
|
|||||||
|
|
||||||
|
|
||||||
/********** wxDbTable::SetColDefs() **********/
|
/********** wxDbTable::SetColDefs() **********/
|
||||||
wxDbColDataPtr* wxDbTable::SetColDefs(wxDbColInf *pColInfs, ULONG numCols)
|
wxDbColDataPtr* wxDbTable::SetColDefs(wxDbColInf *pColInfs, UWORD numCols)
|
||||||
{
|
{
|
||||||
wxASSERT(pColInfs);
|
wxASSERT(pColInfs);
|
||||||
wxDbColDataPtr *pColDataPtrs = NULL;
|
wxDbColDataPtr *pColDataPtrs = NULL;
|
||||||
|
|
||||||
if (pColInfs)
|
if (pColInfs)
|
||||||
{
|
{
|
||||||
ULONG index;
|
UWORD index;
|
||||||
|
|
||||||
pColDataPtrs = new wxDbColDataPtr[numCols+1];
|
pColDataPtrs = new wxDbColDataPtr[numCols+1];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user