]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dbtable.cpp
moved wxapp_install_idle_handler and g_isIdle from many cpp files into gtk/private...
[wxWidgets.git] / src / common / dbtable.cpp
index d5f848518bd079e3ff3db7b34c3e59c8cd5cd1ae..0e781f19a36f8bf6be5a3e662cf6f12f7cbfeb25 100644 (file)
 // SYNOPSIS STOP
 */
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "dbtable.h"
-#endif
-
 #include  "wx/wxprec.h"
 
 #ifdef __BORLANDC__
@@ -417,11 +413,13 @@ void wxDbTable::setCbValueForColumn(int columnIndex)
     switch(colDefs[columnIndex].DbDataType)
     {
         case DB_DATA_TYPE_VARCHAR:
+        case DB_DATA_TYPE_MEMO:
             if (colDefs[columnIndex].Null)
                 colDefs[columnIndex].CbValue = SQL_NULL_DATA;
             else
                 colDefs[columnIndex].CbValue = SQL_NTS;
             break;
+            break;
         case DB_DATA_TYPE_INTEGER:
             if (colDefs[columnIndex].Null)
                 colDefs[columnIndex].CbValue = SQL_NULL_DATA;
@@ -488,6 +486,11 @@ bool wxDbTable::bindParams(bool forUpdate)
                 precision = colDefs[i].SzDataObj;
                 scale = 0;
                 break;
+            case DB_DATA_TYPE_MEMO:
+                fSqlType = pDb->GetTypeInfMemo().FsqlType;
+                precision = colDefs[i].SzDataObj;
+                scale = 0;
+                break;
             case DB_DATA_TYPE_INTEGER:
                 fSqlType = pDb->GetTypeInfInteger().FsqlType;
                 precision = pDb->GetTypeInfInteger().Precision;
@@ -560,7 +563,7 @@ bool wxDbTable::bindUpdateParams(void)
 /********** wxDbTable::bindCols() **********/
 bool wxDbTable::bindCols(HSTMT cursor)
 {
-    static SDWORD cb;
+    static SQLLEN cb;
 
     // Bind each column of the table to a memory address for fetching data
     UWORD i;
@@ -586,7 +589,7 @@ bool wxDbTable::getRec(UWORD fetchType)
     if (!pDb->FwdOnlyCursors())
     {
         // Fetch the NEXT, PREV, FIRST or LAST record, depending on fetchType
-        UDWORD  cRowsFetched;
+        SQLULEN cRowsFetched;
         UWORD   rowStatus;
 
         retcode = SQLExtendedFetch(hstmt, fetchType, 0, &cRowsFetched, &rowStatus);
@@ -1010,7 +1013,7 @@ void wxDbTable::BuildDeleteStmt(wxString &pSqlStmt, int typeOfDel, const wxStrin
             // e.g. DELETE FROM PARTS WHERE ROWID = '111.222.333'
             if (CanUpdateByROWID())
             {
-                SDWORD cb;
+                SQLLEN cb;
                 wxChar   rowid[wxDB_ROWID_LEN+1];
 
                 // Get the ROWID value.  If not successful retreiving the ROWID,
@@ -1227,7 +1230,7 @@ void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpdate, const wxSt
             // e.g. UPDATE PARTS SET Col1 = ?, Col2 = ? WHERE ROWID = '111.222.333'
             if (CanUpdateByROWID())
             {
-                SDWORD cb;
+                SQLLEN cb;
                 wxChar rowid[wxDB_ROWID_LEN+1];
 
                 // Get the ROWID value.  If not successful retreiving the ROWID,
@@ -1418,6 +1421,9 @@ bool wxDbTable::CreateTable(bool attemptDrop)
             case DB_DATA_TYPE_VARCHAR:
                 cout << pDb->GetTypeInfVarchar().TypeName << wxT("(") << (int)(colDefs[i].SzDataObj / sizeof(wxChar)) << wxT(")");
                 break;
+            case DB_DATA_TYPE_MEMO:
+                cout << pDb->GetTypeInfMemo().TypeName;
+                break;
             case DB_DATA_TYPE_INTEGER:
                 cout << pDb->GetTypeInfInteger().TypeName;
                 break;
@@ -1459,6 +1465,9 @@ bool wxDbTable::CreateTable(bool attemptDrop)
             case DB_DATA_TYPE_VARCHAR:
                 sqlStmt += pDb->GetTypeInfVarchar().TypeName;
                 break;
+            case DB_DATA_TYPE_MEMO:
+                sqlStmt += pDb->GetTypeInfMemo().TypeName;
+                break;
             case DB_DATA_TYPE_INTEGER:
                 sqlStmt += pDb->GetTypeInfInteger().TypeName;
                 break;
@@ -2353,6 +2362,11 @@ wxDbColDataPtr* wxDbTable::SetColDefs(wxDbColInf *pColInfs, UWORD numCols)
                    pColDataPtrs[index].SzDataObj  = pColInfs[index].bufferSize+(1*sizeof(wxChar));
                    pColDataPtrs[index].SqlCtype   = SQL_C_WXCHAR;
                    break;
+                case DB_DATA_TYPE_MEMO:
+                   pColDataPtrs[index].PtrDataObj = new wxChar[pColInfs[index].bufferSize+(1*sizeof(wxChar))];
+                   pColDataPtrs[index].SzDataObj  = pColInfs[index].bufferSize+(1*sizeof(wxChar));
+                   pColDataPtrs[index].SqlCtype   = SQL_C_WXCHAR;
+                   break;
                 case DB_DATA_TYPE_INTEGER:
                     // Can be long or short
                     if (pColInfs[index].bufferSize == sizeof(long))
@@ -2431,7 +2445,7 @@ ULONG wxDbTable::Count(const wxString &args)
 {
     ULONG count;
     wxString sqlStmt;
-    SDWORD cb;
+    SQLLEN cb;
 
     // Build a "SELECT COUNT(*) FROM queryTableName [WHERE whereClause]" SQL Statement
     sqlStmt  = wxT("SELECT COUNT(");
@@ -2522,7 +2536,7 @@ bool wxDbTable::Refresh(void)
 
     if (CanUpdateByROWID())
     {
-        SDWORD cb;
+        SQLLEN cb;
         wxChar rowid[wxDB_ROWID_LEN+1];
 
         // Get the ROWID value.  If not successful retreiving the ROWID,