3 Replies Latest reply on Jul 2, 2013 4:01 PM by Lee CS Young

    Merge a Static and Sql List

    Laura Whittle

      We have a data card variable called product name.  It is a sql list based off of the names of subfolders in the products folder.

       

      However we want to make this variable mandatory on the data card, and would like to have the options Not applicable or Combination.

       

      Is there a way to merge static values to the sql list?

        • Re: Merge a Static and Sql List
          Lee CS Young

          Sure, simply add them to your query using a union.

           

          SELECT 'Static Text'
          UNION
          SELECT filename FROM documents WHERE FILENAME LIKE 'CRITERIA'
          
            • Re: Merge a Static and Sql List
              Laura Whittle

              So I just got around to mess with this, and I couldn't get it to work and got some interesting things.  Currently this is the code we have in the Product Name variable list.

               

              Select P.Name

              From Projects P, ProjectTree Pt, Projects P2

              where P.ProjectID > 1 And

              P2.Path Like '\Products\' And

              P2.ProjectID = Pt.ProjectID And

              P.ProjectID = Pt.ChildProject

              Order By P.Name Asc

               

              I would like to add: Not applicable & Combination to the list. Can you give me more guidance on how to do this?

               

              Thanks,

              Laura