15 Replies Latest reply: May 12, 2014 3:48 AM by Valdi Alkitri RSS

    Edit Record on QVD

    Valdi Alkitri

      Guys, I need your help..

       

      How to write script for edit record on QVD?

      for example:

       

      Update table_a

      set Map_2='Other'

      where Map_2='Opex'

       

      Thank before.

        • Re: Edit Record on QVD
          jagan mohan rao appala

          Hi,

          You cannot directly update a QVD instead you need to recreate it again like this

           

          Data:

          LOAD

          Field1,

          Field2,

          If(Map_2 = 'Opex', 'Other', Map_2) AS Map_2

          FROM QVDFileName.qvd;

           

          STORE Data INTO QVDFileName.qvd;

           

          Hope this helps you.

           

          Regards,

          Jagan.

          • Re: Edit Record on QVD
            Srikanth P

            Hi Valdi, there is direct way to edit the record in the QVD.

             

            First you have to load the QVD and edit the record withe ApplyMap or LookUp or If condition. I personally use ApplyMap because its relatively very fast.

             

            First create the Mapping Table with your edit field values.

             

            MAP_EDIT:

            MAPPING LOAD * INLINE [

            Map_2, Map_2_New

            Opex, Other

            Opex1, Other1

            ];

             

            QVDNAME:

            LOAD A, B, C, ApplyMap('MAP_EDIT', Map_2 , Map_2) AS Map_2

            From QVDNAME.qvd (qvd);

             

            STORE QVDNAME into QVDNAME.qvd (qvd) ;

             

            DROP Table QVDNAME ;