4 Replies Latest reply: Dec 10, 2013 3:21 PM by Rayna Curtis RSS

    Appending to a list in a script

    Rayna Curtis

      I have a hardcoded list of statuses in my database.  I created the status list below so that we "translate" the statuses into something meaningful to the client.  Until last week these were static and non-configurable.


      We have added a table to our database - it will only ever contain a single record so that our clients can add a single configurable status to their own databases.  It can be whatever two letter code they want, and whatever description they want.

       

      As a result, this newly configured status now needs to be added to the previously static list as a selector.

       

      1) Is this even doable?

      2) If so, how?

       

      I have tried importing the record and then adding the two fields I imported into the listing but I get the name of the field as a string, not the contents of the field.

       

      What am I missing?  Anything to point me in the right direction would be appreciated!

       

      Here is what I tried:

       

      LOAD

          "sc_status_code",

          "status_description"

          ;

      SQL SELECT *

      FROM scaltstat;

       

      booking_status_descriptions:

      load * inline [

          'Current Booking Status', 'Booking Status Description'

          qt, 'Quote/Proposal'

          tn, 'Tentative'

          cf, 'Confirmed/Definite'

          xl, 'Cancelled'

          po, 'Posted'

          sc_status_code, status_description

      ];

        • Re: Appending to a list in a script
          Tyrone Fay

          Hi,

           

          A quick reply and sorry if I am wrong.... but... how about....:

           

          TheFullList:

          LOAD

          sc_status_code,

          status_description;

          SQL SELECT * FROM scaltstat;

           

          Concatenate (TheFullList)

           

          Load * InLine [sc_status_code, status_description

          ....

          ....

          ...
          ];

           

          Basically I think you are missing a Concatenate

          • Re: Appending to a list in a script

            Hello;

             

            If I understand you want to concatenate table 1 to table 2 (sc_status_code and status_description) and you can try this:

             

            booking_status_descriptions:

            load * inline [

                'Current Booking Status', 'Booking Status Description'

                qt, 'Quote/Proposal'

                tn, 'Tentative'

                cf, 'Confirmed/Definite'

                xl, 'Cancelled'

                po, 'Posted'

            ];

             

            LOAD

                "sc_status_code" as [Current Booking Status],

                "status_description" as [Booking Status Description]

                ;

            SQL SELECT *

            FROM scaltstat;

             

             

            Or if you want to load SQL table try this:

            booking_status_descriptions:

            LOAD

                "sc_status_code" as [Current Booking Status],

                "status_description" as [Booking Status Description]

                ;

            SQL SELECT *

            FROM scaltstat;

             

            load * inline [

                'Current Booking Status', 'Booking Status Description'

                qt, 'Quote/Proposal'

                tn, 'Tentative'

                cf, 'Confirmed/Definite'

                xl, 'Cancelled'

                po, 'Posted'

            ];

             

            Tell me if it works.