2 Replies Latest reply: May 5, 2015 5:09 AM by Dermot mcgoldrick RSS

    Recording a daily history

    Dermot mcgoldrick

      I have a number of applications that help manage open order book and open Purchase Orders etc.  I'd like to be able to record a history each day, ie total lines, total for each customer, order status etc.  I expect something like a couple of hundred lines a day appended to a history.

       

      I'd imagine someone has already done this, in my mind all I do is create a history table each day, showing that days date and the requisite set of data, I then append this to an existing qvd each day?  Is this the right approach and if so has anyone got a link to somewhere this has been done before, I had a look without finding anything concrete.

        • Re: Recording a daily history
          Friedrich Hofmann

          Hi .Dermot,

           

          you are basically right. If all you want to do is append every day's new records to the history and you don't have to worry about your history_table (qvd) growing, then it's rather easy.

          All you do is (the very first time) load the table such as you want it (check in a straight_table or so) and store it into a qvd using the STORE command - just remember to add the ending .qvd to it.

          The second time - and every time from then on - you load that qvd (it must contain a date obviously), then execute your code, append the final table to the loaded history table (you can use a WHERE NOT EXISTS(date) clause in the LOAd to make sure that, when running the app twice on the same day, that isn't appended) and store it to qvd again.

          That's it basically.

          HTH