Store and drop the table in QVD using a subroutine

    Hi Folks,

     

    Hope this document wil help of beginner in order to avoid multiple store and drop statement while storing the information in QVD.

     

    //Qvd Path

    Let vQvdPath = 'Qvd\';

     

    //Sub Routine Start

    Sub StoreStatement

    //Store the table in Qvd

    Store $(vTableName$(index)) into $(vQvdPath)$(vTableName$(index)).qvd(qvd);

    //Drop the table

    DROP Table $(vTableName$(index));

    //Sub Routine End

    ENDSUB

     

    /********************************* Table Information ****************************************************/

    InlineTable1:

    LOAD * Inline

    [

    A, B

    1, 2

    ];

     

    InlineTable2:

    LOAD * Inline

    [

    C, D

    1, 2

    ];

     

    /*********************************************************************************************************/

     

    //Store the table name in variables

    Let vTableCount =  NoOfTables()-1;

     

    For index = 0 to $(vTableCount)

    Let vTableName$(index) = TableName($(index));

    NEXT;

     

    //Call the sub routine

    For index = 0 to $(vTableCount)

    CALL StoreStatement

    NEXT;