Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2010

    Unanswered: Problem using db2Reorg API in C++

    Hi everyone,

    I'm trying to use the db2 api on c++ to do an inplace reorg, here is my code :

    struct sqlca sqlca;
    ds << "Reorganizing table " << tableName << "...";
    db2ReorgStruct paramsTableReorg;
    memset(&paramsTableReorg, '\0', sizeof(paramsTableReorg));
    paramsTableReorg.reorgObject.tableStruct.pTableName = (char*)tableName.c_str();
    paramsTableReorg.reorgObject.tableStruct.pOrderByIndex = NULL;
    paramsTableReorg.reorgObject.tableStruct.pSysTempSpace = NULL;
    paramsTableReorg.reorgType = DB2REORG_OBJ_TABLE_INPLACE;
    paramsTableReorg.reorgFlags = DB2REORG_START_ONLINE | DB2REORG_ALLOW_WRITE;
    paramsTableReorg.nodeListFlag = DB2REORG_ALL_NODES;
    paramsTableReorg.numNodes = 0;
    paramsTableReorg.pNodeList = NULL;
    int rc = db2Reorg(db2Version812, &paramsTableReorg, &sqlca);
    API_SQL_CHECK("Error reorganizing table " + tableName);
    So, I keep getting this error : "SQL2032N The "" parameter is not valid."
    I've been looking on google a lot and I can't find anything on that error using the db2Reorg API...

  2. #2
    Join Date
    Jul 2010
    The information on what my code is based on can be found on that page :
    IBM DB2 9.5 Information Center for Linux, UNIX, and Windows

    I've also tried to make it work to reorganize indexes, and still, I get the same message :

    	struct sqlca sqlca;
        struct db2ReorgStruct paramsIndexReorg;
        memset(&paramsIndexReorg, 0x00, sizeof(paramsIndexReorg));  // Zero out everything.
        paramsIndexReorg.reorgObject.indexesAllStruct.pTableName = (char*) tableName.c_str();
        paramsIndexReorg.reorgType = DB2REORG_OBJ_INDEXESALL;
        paramsIndexReorg.reorgFlags = DB2REORG_OPTION_NONE;
        paramsIndexReorg.nodeListFlag = DB2REORG_ALL_NODES;
        paramsIndexReorg.numNodes = 0;
        paramsIndexReorg.pNodeList = NULL;  
        db2Reorg(db2Version812, &paramsIndexReorg, &sqlca);
        API_SQL_CHECK("Error reorganizing indexes for table " + tableName);
    If you need any information, please ask me!

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts