4 Replies Latest reply: Apr 18, 2016 2:40 PM by Sunny Talwar RSS

    Interesting Challenge: How to store a table based on a specific number of rows?

    John Blomqvist

      Hola amigos,

       

      I have a interesting challenge below and the question at the end.

       

      I have a script that looks like the following:

       

      TableA:

      LOAD

      'TableA' as Source,

      <fields>

      From source;

       

      Concatenate(TableA)

      TableB:

      LOAD

      'TableB' as Source,

      <fields>

      From source;

       

      ...etc

       

      Then I have:

       

      NewTableA:

      LOAD

      *,

      <more fields>

      Where Source = 'TableA'

      Resident TableA;

       

      STORE NewTableA into folder\NewTableA.txt(txt);

       

      NewTableB

      LOAD

      *,

      <more fields>

      Where Source = 'TableB'

      Resident TableA;

       

      STORE NewTableB into folder\NewTableB.txt(txt);

      -------------------------------------


      What I would like to do is to specify for each store statement how many rows to store from each table. The number of rows to store would be specified by a user.

       

      I imagine I will need to use a variable (e.g. vTableARows, vTableBRows etc) to store the number of rows.

       

      But how can I integrate that into my script so that the eventual text file only stores the number of rows of data for each table?