4 Replies Latest reply: Jun 3, 2013 6:20 AM by Prashant Adhav RSS

    Direct Discovery usage

    Dan-Ketil Jakobsen

      Hi

       

      I have an app that uses the foloowing code:

      ActualTag:

      LOAD

          SegmentResponseGlobId,

          DateTime,

          Tagname,

          Value,

          UOM;

      SQL SELECT *

      FROM MESLogDB.dbo.ActualHistorian;

       

      It returns a number of tags pr datetime with value for me to build trends on.

      The SegmentResponseGlobId is the key.

       

      The table is huge so what I now want is to get only the data for a spesific SegmentResponseGlobId.

      I have another report where we list all SegmentResponseGlobId and current data. I want the user to choose a spesific SegmentResponseGlobId and then jump to this new report, ActualTagHisotry.

      This should then fire the sql based in the input field and return the following four fields.

         DateTime,

          Tagname,

          Value,

          UOM;

      Another option is to buid the SegmentResponseGlobId list in my ActualTagHisotry report and they choose from there, and then the sql code fires. I prefer the first, but I am fine with the latter as well.

       

      Comments on apporach?

       

      BR

      Dan

        • Re: Direct Discovery usage
          Dan-Ketil Jakobsen

          I tried to build with the following

           

          CurrentTag:

          DIRECT SELECT

              SegmentResponseGlobId

              ,DateTime

              ,Tagname

              ,Value

              ,UOM

          FROM  $(StringSQL);

           

          ActualTag:

          LOAD

              SegmentResponseGlobId

          /*    ,DateTime

              ,Tagname

              ,Value

              ,UOM */

              ;

          SQL $(StringSQL);

           

          Not really sure if I would need the AactualTag Section. I have another tab where I get all the batch info and also the SegmentResponseGlobId that is used in my direct statement

          A user select a batch and press the store button, this stores the following sql query code:

           

          SELECT * FROM MESLogDB.dbo.ActualHistorian where SegmentResponseGlobId ='E35907E8-E422-4801-805C-5394D07E3330'

           

          Ideally I do not want the button. It should be that the user select a batch and upon clikcing a batch the direct sql  code should start

           

          When trying to tun, the code stops giving the following error:

          Unknown statement

          CurrentTag:

           

          DIRECT SELECT

              SegmentResponseGlobId

              ,DateTime

              ,Tagname

              ,Value

              ,UOM

          FROM  SELECT * FROM MESLogDB.dbo.ActualHistorian where SegmentResponseGlobId ='E35907E8-E422-4801-805C-5394D07E3330'

           

          Hope that somebody can provide som input on what I am doing wrong.

           

          BR

          Dan