Topic
  • 2 replies
  • Latest Post - ‏2014-01-07T08:21:35Z by Fandino
Fandino
Fandino
7 Posts

Pinned topic ADMIN_CMD LOAD error handling

‏2013-11-12T12:54:41Z |

Hello

I have a stored procedure loading some data from a file using the ADMIN_CMD procedure. When there is any issue regarding the load, a SQLCODE SQL3107W (at least one warning message encountered during load operation - the warning does not affect processing) is always generated. According with the documentation, I should expect a SQL2039W7 return code from ADMIN_CMD, but not error raised. Instead, the handler gets fired and I cannot access the result set from ADMIN_CMD, because the procedure has not been called (SQLSTATE=51030).

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION, SQLWARNING

SET svMESSAGE_CODE = SQLCODE;
                
CALL SYSPROC.ADMIN_CMD('LOAD FROM "C:\TEST.TXT" OF DEL MODIFIED BY dateformat="YYYYMMDD" timeformat="HH:MM:SS" coldel| decpt. chardel"" MESSAGES ON SERVER INSERT INTO "SCH.TEST" );
            
ASSOCIATE RESULT SET LOCATOR (bsLOAD_MESSAGE) WITH PROCEDURE SYSPROC.ADMIN_CMD;
ALLOCATE brLOAD_MESSAGE CURSOR FOR RESULT SET bsLOAD_MESSAGE;
FETCH FROM brLOAD_MESSAGE INTO  bvROW_READ_COUNT, bvROW_SKIPPED_COUNT, bvROW_LOADED_COUNT, bvROW_REJECTED_COUNT, bvROW_DELETED_COUNT, bvROW_COMMITTED_COUNT, bvROW_PARTITIONED_COUNT, bvAGENT_INFO_ENTRY_COUNT,  bvMSG_RETRIEVAL, bvMSG_REMOVAL;
CLOSE brLOAD_MESSAGE;

Any idea? I am using DB2 10.5 in a Windows environment

Many thanks

  • Diego Marecos
    Diego Marecos
    1 Post

    Re: ADMIN_CMD LOAD error handling

    ‏2013-12-27T13:47:15Z  

    I have the same problem, how do you resolved?

  • Fandino
    Fandino
    7 Posts

    Re: ADMIN_CMD LOAD error handling

    ‏2014-01-07T08:21:35Z  

    I have the same problem, how do you resolved?

    Hi Diego

    I am afraid no solution yet.