If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Problem using db2Reorg API in C++

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-08-10, 09:26
philouh philouh is offline
Registered User
 
Join Date: Jul 2010
Posts: 2
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 :

Code:
struct sqlca sqlca;

activateConnection();
	
ds << "Reorganizing table " << tableName << "...";
ds.endlds();

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...
Reply With Quote
  #2 (permalink)  
Old 07-12-10, 08:51
philouh philouh is offline
Registered User
 
Join Date: Jul 2010
Posts: 2
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 :

Code:
	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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On