2

次のコードを実行しようとしています。

SQLSMALLINT** column_types = new SQLSMALLINT*[*ColumnCount];


void** ColumnsData = new void*[*ColumnCount];

SQLINTEGER** rowLengths = new SQLINTEGER*[*ColumnCount];

int limit = *ColumnCount;
for(int i=0;i<limit;i++)
{
    column_types[i] = new SQLSMALLINT();
     SQLColAttribute(hStmt,i+1,SQL_DESC_TYPE,NULL,NULL,NULL,(SQLPOINTER)column_types[i]);
     SQLSMALLINT type = *column_types[i];
     switch(type)
     {
     case SQL_CHAR:

             ColumnsData[i] = new SQLCHAR**[*RowCount];
             for(int l=0;l<*RowCount;l++)
             {
                 ((SQLCHAR**)ColumnsData[i])[l] = new SQLCHAR[512];
             }

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_CHAR,ColumnsData[i],512,rowLengths[i]);
            break; //<<<<<<<<<<<<<<<<<<<<<<<<<<<

     case SQL_VARCHAR:

             ColumnsData[i] = new SQLCHAR**[*RowCount];
             for(int l=0;l<*RowCount;l++)
             {
                 ((SQLCHAR**)ColumnsData[i])[l] = new SQLCHAR[512];
             }

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_VARCHAR,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_LONGVARCHAR:

             ColumnsData[i] = new SQLCHAR**[*RowCount];
             for(int l=0;l<*RowCount;l++)
             {
                 ((SQLCHAR**)ColumnsData[i])[l] = new SQLCHAR[512];
             }

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_LONGVARCHAR,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_WCHAR:

             ColumnsData[i] = new SQLWCHAR**[*RowCount];
             for(int l=0;l<*RowCount;l++)
             {
                 ((SQLWCHAR**)ColumnsData[i])[l] = new SQLWCHAR[512];
             }

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_WCHAR,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_WVARCHAR:

             ColumnsData[i] = new SQLWCHAR**[*RowCount];
             for(int l=0;l<*RowCount;l++)
             {
                 ((SQLWCHAR**)ColumnsData[i])[l] = new SQLWCHAR[512];
             }

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_WVARCHAR,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_WLONGVARCHAR:

             ColumnsData[i] = new SQLWCHAR**[*RowCount];
             for(int l=0;l<*RowCount;l++)
             {
                 ((SQLWCHAR**)ColumnsData[i])[l] = new SQLWCHAR[512];
             }

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_WLONGVARCHAR,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_DECIMAL:

             ColumnsData[i] = new SQL_NUMERIC_STRUCT[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_DECIMAL,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_NUMERIC:

             ColumnsData[i] = new SQL_NUMERIC_STRUCT[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_NUMERIC,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_SMALLINT:

             ColumnsData[i] = new SQLSMALLINT[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_SMALLINT,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_INTEGER:

            ColumnsData[i] = new SQLINTEGER[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_INTEGER,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_REAL:

             ColumnsData[i] = new SQLREAL[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_REAL,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_FLOAT:

             ColumnsData[i] = new SQLREAL[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_FLOAT,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_DOUBLE:

             ColumnsData[i] = new SQLDOUBLE[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_DOUBLE,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_BIT:

             ColumnsData[i] = new SQLCHAR[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_BIT,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_TINYINT:

             ColumnsData[i] = new SQLSCHAR[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_TINYINT,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_BIGINT:

             ColumnsData[i] = new SQLBIGINT[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_BIGINT,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_BINARY:

             ColumnsData[i] = new SQLCHAR**[*RowCount];
             for(int l=0;l<*RowCount;l++)
             {
                 ((SQLCHAR**)ColumnsData[i])[l] = new SQLCHAR[512];
             }

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_BINARY,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_TYPE_DATE:

            ColumnsData[i] = new SQL_DATE_STRUCT[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

//>>>>>>>>>>>>>>>
             SQLBindCol(hStmt,i+1,SQL_TYPE_DATE,ColumnsData[i],512,rowLengths[i]);
             break;

     case SQL_TYPE_TIME:

             ColumnsData[i] = new SQL_TIME_STRUCT[*RowCount];

             rowLengths[i] = new SQLINTEGER[*RowCount];

             SQLBindCol(hStmt,i+1,SQL_TYPE_TIME,ColumnsData[i],512,rowLengths[i]);
             break;

     default:

             break;

     }
}

ケース SQL_CHAR に入り、ブレークするようになると、SQLBindcol 呼び出しの前にケース SQL_TYPE_DATE にジャンプします。どのように可能でしょうか。ブレークがスイッチを終了するはずなので、誤動作か、ここで何か間違ったことをしていますか?

4

3 に答える 3