7 Replies Latest reply: Feb 8, 2012 2:49 PM by Jason Michaelides RSS

    Simple order by question

    Ivan Troisi

      Hi all.. I employed a order by function but I discovered that never worked. My syntax is:

       

      History:

       

      LOAD
      user_id,
           bug_id,
           date_modified,
           prioridad,
           reabierto
      FROM
      [C:\Repositorios\Intelmed\Mantis\L1\Cambios]
      (qvd);
          
      Concatenate

      LOAD

           user_id,
           bug_id,
           date_modified,
           prioridad,
           reabierto
      FROM
      [C:\Repositorios\Intelmed\Mantis\L1\Ultimo]
      (qvd);

      Store History into [C:\Repositorios\Intelmed\Mantis\L1\History];

       

      LOAD
           bug_id,
           user_id,
           date_modified,
           prioridad,
           reabierto
      Resident Historial
      order by bug_id , date_modified, prioridad;         

      Store History into [C:\Repositorios\Intelmed\Mantis\L1\History];

      drop table History;

       

       

       

       

      What could the problem be?

       

      Thank.

       

      Ivan. 

        • Simple order by question
          Ivan Troisi

          Sorry.. in Resident i employed History. thank!.

           

          Ivan

            • Simple order by question
              Jason Michaelides

              I think your issue is that the RESIDENT load is concatenating to the main table.  Try changing your last script section to:

               

              NoConcatenate

              LOAD

                   bug_id,

                   user_id,

                   date_modified,

                   prioridad,

                   reabierto

              Resident History

              order by bug_id , date_modified, prioridad;        

              Store History into [C:\Repositorios\Intelmed\Mantis\L1\History];

              drop table History;

               

              Also, I don't know why you are storing to the same QVD file twice.  Remove the first STORE command?

               

              Hope this helps,

               

              Jason

                • Re: Simple order by question
                  Ivan Troisi

                  Hi, thank very much Jason, i remove the first store, it was a mistake to copy and paste. i change my script but also it doesnt work.

                   

                  My new script:

                   

                  Historial:

                   

                  LOAD
                  user_id,
                       bug_id,
                       date_modified,
                       prioridad,
                       reabierto
                  FROM
                  [C:\Repositorios\Intelmed\Mantis\L1\Cambios]
                  (qvd);
                      
                  Concatenate

                  LOAD user_id,
                       bug_id,
                       date_modified,
                       prioridad,
                       reabierto
                  FROM
                  [C:\Repositorios\Intelmed\Mantis\L1\Ultimo]
                  (qvd);


                  NoConcatenate

                   

                  LOAD
                  bug_id,
                  user_id,
                        date_modified,
                       prioridad,
                       reabierto
                  Resident History
                  order by bug_id ,date_modified, prioridad;

                  Store Historial into [C:\Repositorios\Intelmed\Mantis\L1\Historial];

                   

                  Please take a look at the qvd.

                   

                  Thanks in advance.

                   

                  Ivan.

                    • Re: Simple order by question
                      Ivan Troisi

                      I need only order by: first bug_id, second  date_modified and third prioridad.

                       

                      Thanks!.

                       

                      Ivan.

                        • Re: Simple order by question
                          Jason Michaelides

                          I think you need to declare a name for the second table load, and don't forget to drop the first.  So:

                           

                          Historial_temp:

                           

                          LOAD
                          user_id,
                               bug_id,
                               date_modified,
                               prioridad,
                               reabierto
                          FROM
                          [C:\Repositorios\Intelmed\Mantis\L1\Cambios]
                          (qvd);
                              
                          Concatenate (Historial_temp)


                          LOAD user_id,
                               bug_id,
                               date_modified,
                               prioridad,
                               reabierto
                          FROM
                          [C:\Repositorios\Intelmed\Mantis\L1\Ultimo]
                          (qvd);

                           

                          Historial:
                          NoConcatenate

                          LOAD
                          bug_id,
                          user_id,
                                date_modified,
                               prioridad,
                               reabierto
                          Resident History
                          order by bug_id ,date_modified, prioridad;

                          Store Historial into [C:\Repositorios\Intelmed\Mantis\L1\Historial];

                           

                          DROP TABLE Historial_temp;

                           

                           

                          Give that a go.

                           

                          Jason

                  • Simple order by question
                    Ivan Troisi

                    Jason, it works!.

                     

                    Thank you very much.

                     

                    Regards.

                     

                    Ivan.