Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    30

    Unanswered: Warnings in ADMIN_CMD

    Hello All,

    Good day.

    I'm having a problem with the use of the ADMIN_CMD.

    I wanted to create a backup of critical tables we are using for immediate access. All tables are stored in the database server itself.

    An SQL procedure was created in this manner.

    While CUR_ITEM_FOUND = 0 Do

    -- Set export only engine_id = 4 for Forecast table
    SET whereclause = (CASE
    WHEN v_TABLENAME = 'FORECASTDETAIL' then ' where engine_id = 4'
    ELSE
    ''
    END);

    -- build export string
    SET backupstr = ltrim(rtrim('EXPORT to '||homedir||destdir||v_TABLETYPE||'/'||v_TABLENAME||'.ixf OF ixf MESSAGES /home/intuser/WEEK2/SCMVAL/EXPORT.txt select * from '||v_TABLETYPE||'.'||v_TABLENAME||whereclause));

    -- Check
    insert into w_test (EXP_STRING) values backupstr;
    commit;

    -- call export proc
    CALL SYSPROC.ADMIN_CMD (backupstr);
    commit;


    FETCH FROM CUR_ITEM INTO v_TABLENAME, v_TABLETYPE, v_PRIORITY;
    End While;


    It does it job actually. But the procedure stops whenever it encounters a warning. e.g. SQL3132W The character data in column "SERIALIZEDVALUE" will be truncated to
    size "32700".

    It should not stop until it has exported all tables in a list.

    Is there a way to trap this warning so that the procedure will continue to the next table?

    Thanks a lot for any advices and suggestions.

    DROGO

  2. #2
    Join Date
    Jun 2006
    Posts
    471
    it has todo with the export of long fields
    try with option lobsinfile on the export command
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Mar 2007
    Posts
    30
    SET backupstr = ltrim(rtrim('EXPORT to '||homedir||destdir||v_TABLETYPE||'/'||v_TABLENAME||'.ixf OF ixf LOBS TO '||homedir||destdir||v_TABLETYPE||'/'||v_TABLENAME||'_LOB MESSAGES '||homedir||destdir||v_TABLETYPE||'/EXPORT.txt select * from '||v_TABLETYPE||'.'||v_TABLENAME||whereclause));


    I modified the export string to the one above. LOB TO is supposed to activate the LOBSINFILE. Same behaviour. Once a warning is encountered the procedure ends with a warning. No errors. It does not complete the export for all tables.

    Please advise.

    Thanks again.

Posting Permissions

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