Passing TestStand Variable to Database Options field

I seem to be having an issue with a non-optimized database query possibly because of a TestStand limitation or my limited knowledge of TestStand, probably the latter. What is currently happening is a custom type logs its data through a statement setup in the Database Options. This statement has a primary key reference and grabs that primary key from a recordset returned by this query:
              "SELECT id FROM step_result order by date_time desc limit 1".
This query can take around 30 seconds or longer to run which is way too long for a database query returning 1 row.
What I'd like to do is change that query, inside of the Database Options, to utilize a StationGlobals variable which will drastically speed this query up.
I'm doing the same query, with proper WHERE clauses, in another place (as a work-around solution to this same problem, which may be reverted if I fix this problem) and it is laid out as followed:
"SELECT id  FROM step_result where uut_result=\""+ StationGlobals.UUT_Result_ID +"\"  order by date_time desc limit 1"
I need that query to be run, with that variable, in the database options statement. Is this possible to do in TestStand? The problem I've seen so far is that the "Command Text" entry for the "Get Value from Recordset" doesn't like variables and string concats. Am I missing something obvious?
Thanks in advance for any help.

The way our database is designed, this involves 3 different tables:
step_result - ID Primary kefield
meas_mul_numericlimit - ID primary key, foreign key of step_result ID field
meas_mul_numericlimit_info - Primary and foreign key for step_result ID field
A "parent" row is added into the step_result table, if the step type is of MultipleNumericLimitTest, a row is added into the m_m_n_i to hold graphing information and the actual data is inserted into the m_m_n table.
The MNLT step type uses the query to get the ID of the last entered step_result for the m_m_n_i table to setup the proper relationship. The problem is we need a specific s_r ID for everything to work properly. Obviously the Type definition is a "post processing" method as it can get the current step's ID from the database. The problem is that query isn't optimized and sorting 500k rows is incredibly slow.
The other problem, which I used a workaround on, dealt with a similar yet different situation.
In our Main sequence file, we had a sequence which would establish graphing features for tests whose measurements are spread across different "parents"/steps. We would establish the m_m_n_i information and then associations for a graph_parent field. What I did in that case was, create the association, then using normal SQL steps, gather the ID field and then update the ID for the graph_parent. Since this process was done pre-tests/measurements, I had the luxury to be able to do these steps outside of the database options field. In the other case though, its mid-test and based on measurements so I can't do the same workaround.
One thing I was wondering also is, in the processing of the custom type, is there a way to access the ID of the currently being processed step? If there was a variable for that, then I could just use the expression field.
Does this help/explain this a little better?

Similar Messages

  • How to pass the Data to sclect option field in module pool??

    Hai Experts,
                         I have Created the Select-Options using Sub screen its working fine for me.
    But the problem is when i pass the data to one of the my select options field its not  showing  in display mode..
    please me this
    i created select option slike this,
    SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
    SELECT-OPTIONS : s_kunnr  FOR wa_zcodntr-fin_kunnr,
                                  s_altkn FOR wa_zcodntr-altkn.
    SELECTION-SCREEN END OF SCREEN 400 .
    Thanks ,
    Adv.

    Thanks SAP_wiz kick replay,
    Actullay in my module pool screen i have to select option field like F1 and F2
    any one filed give the input and excute pick the coresponding data for F2 (select option) field and  display  and vice -versa.

  • Assign return itab to select options field

    Hi Dear Experts,
    I am not be able to pass "r_pobjid" to a select-options field
    clearly as desired as well.
    As already mentioned r_pobjid must be presented to a
    select options field after the user has made his selections.
    Can you pls give me deciding  hint to solve the problem.
    This below demonstrated solution doesn't work.
    Regards
      CALL FUNCTION 'RP_PNP_ORGSTRUCTURE'
        TABLES
          pobjid = r_pobjid.
      p_orgeh-high = r_pobjid.
      p_orgeh-sign = 'I'.
      p_orgeh-option = 'EQ'.
      APPEND p_orgeh.

    I think you need pass
    Loop at r_pobjid
    1).
    p_orgeh-low = r_pobjid.
    p_orgeh-high = r_pobjid.
    p_orgeh-sign = 'I'.
    p_orgeh-option = 'BT'.
    APPEND p_orgeh.
    2). or
    p_orgeh-low = r_pobjid.
    p_orgeh-sign = 'I'.
    p_orgeh-option = 'EQ'.
    APPEND p_orgeh.
    endloop.

  • Storing carriage return and other special characters in a TestStand variable and passing to LabVIEW

    I am using TestStand step to call a LabVIEW VI that writes commands to a serial device.  The device expects a carriage return at the end of the command.  I can create a constant string in TestStand with the carriage return, e.g., "ATA\x0D" and pass that to a LabVIEW string control which shows ATA\r and the VI works properly.
    To provide consistency and flexibility in my code, I want to store the terminator character(s) in a TestStand variable.  However, when I try to use an expression to create the command string, i.e. "ATA" + "Locals.Terminator", where Locals.Terminator is set to "\x0D", my LabVIEW VI string control shows "ATA\\x0D" which doesn't work.  And when I try Locals.Terminator set to "\r", the LabVIEW string control shows "ATA\\r" which doesn't work either.
    Is there a way to store special characters in a TestStand variable and pass them to LabVIEW as special characters?  I saw in another post that if you edit the TestStand variable by pressing Cntl-Enter, it will store  the newline \n properly and it can be sent to LabVIEW - that works for me as well for \n.  But  I need to send a carriage return.
    I've attached my test sequence and the corresponding LabVIEW VI with a string control.
    Hans
    Attachments:
    Special Chars.seq ‏27 KB
    String Passing.vi ‏13 KB

    Hi Hans, 
    Thanks for your detailed explanation and examples.  In TestStand, change the String parameter's String Type to Binary String instead of ASCII.  Then it will pass the desired value.
    Cheers,
    David Goldberg
    National Instruments
    Software R&D

  • Error when passing automation refnum to teststand variable

    Hi All
    I am trying to pass an automation refnum to teststand. However when i run the sequence i get the following error in the teststand variable watch i setup after the vi has run.
     Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
    The Automation open is calling an activeX which is configured to use DCOM for remote operation.
    I pass the refnum as an indicator from the vi and then use a function to set the local variable in teststand.
    I have also tried using the Teststand set property.vi but this will not accept the refnum as an input value even though i set the type to 'object'.
    Thanks in advance for any help with this.

    Hi George,
    I have configured DCOM as per the Article, and disabled all firewalls but i still get the error. Attached is a set of screen shots that's shows the labview function does not error but in teststand it does.
    I can also see from the Task Manager on the remote instrument that the function opens an instance of the application therefore suggesting that the DCOM is configured correctly.
    Regards
    Daz
    Message Edited by Daz37 on 10-19-2009 03:51 AM
    Attachments:
    VSA_REF_Error.doc ‏119 KB

  • Nac Guest Server: SMS Optional fields and special variables

    I want to include the sponsor email address in the SMS body. Is there a way to do it?
    I also notice there are 5 optional fields, how do we use that fields? Cisco doco doesnt mention much about the 5 additional fields.
    Cheers,

    Would this help?
    http://www.cisco.com/en/US/docs/security/nac/guestserver/configuration_guide/20/g_hotspots.html#wp1071198
    Sent from Cisco Technical Support iPhone App

  • "-2147417851" during "Get Database Options" of the process model

    Hi guys, I am trying to find the cause for this error message, would greatly appreciate if someone can advise me on what can cause this.
    The exact step where this error occured is shown in the screenshot attached.
    Also, the only thing that I know about this step is it "read database options" from a location on disk.
    Does anyone know what file it reads from, and perhaps, which part of the file?
    Cheers!!
    Attachments:
    20-09-2011 5-21-35 p.m..JPG ‏391 KB

    Simon -
    The "Read Database Option - Read Options" step calls the ReadDatabaseOptions method which takes two parameters (Parameters.DatabaseOptions and Parameters.CfgDir).
    Parameters.CfgDir is simply a string. But you'll notice that Parameters.DatabaseOptions is a container (named type: DatabaseOptions). Most likely what is happening here is that by using the TestStand 2.0.1 process model, you've carried over the old DatabaseOptions type definition and are now passing it to the new TestStand Database Logging server's ReadDatabaseOptions method, which expects the DatabaseOptions container to have a boolean field called UseTransactionProcessing.
    I recommend upgrading the DatabaseOptions type to the TestStand 2010 SP1 version. More so, I recommend porting your TestStand 2.0.1 process model customizations to the TestStand 2010 SP1 process model to ensure you avoid encountering other situations similar to this.
    Hope this helps!
    Manooch H.
    National Instruments

  • Passing two variables in the body of the URL using the go to detail page SB in ASP

    Hi all,
    Would appreciate your assistance with the following, I'm
    trying to set up a go to detail page sb that passes two variable in
    the body of the URL rather than the standard one.
    The code i've tried is -
    <td><A HREF="gggggggtest.asp?<%=
    Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
    "PCL2ID=" + othermenutwo.Fields.Item("PCL2ID").Value
    %>&amp;"PCL1ID=" +
    othermenutwo.Fields.Item("PCL2PC1ID").Value
    %><%=(othermenutwo.Fields.Item("PCL2Description").Value)%></A></td>
    Where the PCL1ID and the PCL2ID are the variables
    The normal code generated by the go to detail page sb with
    one variable is -
    <td><a href="ggggggtest.asp?<%=
    Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
    "PCL2ID=" + othermenutwo.Fields.Item("PCL2ID").Value
    %>"><%=(othermenutwo.Fields.Item("PCL2Description").Value)%></a></td>
    Unfortunatley my code tweaking isn't working as the second
    variable isn't being sent, any help would be gratefully appreciated
    Thanks

    Instead of using DW's 'go to detail page' option, simply set
    up the link the manual way in DW using the Link browser. Select the
    file you want to link to and then use the parameters button at the
    bottom of the 'Select File' dialogue to set the parameters to be
    passed with the link. You can then manually set the name of the
    parameter to be passed and then select its value from a recordset.
    The key thing is that you can set as many parameters as you like,
    so you can set both the parameters you want.
    On the detail page you then filter by the parameter name you
    chose (or both).
    Personally I always code links this way rather than using the
    go to detail page option as you get much better control of what is
    going on.

  • Select options fields at FuBa

    How can I define select options fields as import paramter at Function Modules ?
    Because I intend to pass select options fields to a FM in order to implement the below shown
    code .
    FUNCTION xyz
    importing
    ID
    DESCRIPTION
    CHANGING
       REFERENCE(ZSC_INFO) TYPE  SC_INFO
    select * from  SC_INFO into corresponding fields of table ZSC_INFO
    where
    ID                       in    so_id      and
    DESCRIPTION    in    so_des      and
    ENDFUNCTION

    Hi,
    The question is not completely clear to me but if you want to use the value of the select option and use it as an import parameter in a function module then some tips can be:
    1. The value of the select option can be singles values or a range. Need to pick up the right values.
    2. The import parameter and the variable you want to use must be of the same type.
    DATA: tp_id TYPE <data type from the import parameter of the FM TEST>.
    tp_id = so_vkorg-low "select option vkorg, you can use so_vkorg-high also for single values
    CALL FM 'TEST'
      IMPORT
        ID = tp_id
      EXPORT
        DESCRIPTION = tp_description.
    I hope that this is what you are looking for.
    Best regards,
    Guido Koopmann

  • Is it possible to pass a variable in FROM clause in SQL?

    Hi Experts,
    <i><b>loop at it_db_table.
    select field1 from it_db_table-table_name into my_it.
    endloop.</b></i>
    I mean, Is it pass a variable value to FROM clause in SQL?
    I got the info from SAP as,
    <i><b>Works like variants 1-3, provided the source_text varialb contains the table name or a join expression as ABAP source text.
    Examples
    Output of a list of all customers:
    DATA  tabname(10).
    DATA: BEGIN OF wa,
            id   TYPE scustom-id,
            name TYPE scustom-name,
          END OF wa.
    tabname = 'SCUSTOM'.
    SELECT id name INTO CORRESPONDING FIELDS OF wa FROM (tabname).
      WRITE: / wa-id, wa-name.
    ENDSELECT.</b></i>
    thanq.

    Here is a short sample of a dynamic select statement.
    Enter your table name in the parameter on selection screen. Enter you where clause in the select-option on selection screen.
    I used.....
    MARA
    MTART = 'HALB'
    report zrich_0004 .
    data: xwhere(30) type c.
    data: iwhere(30) type c occurs 0.
    data:itab(1000) type c occurs 0 with header line.
    parameters: p_table(30) type c.
    select-options: s_where for xwhere.
    loop at s_where.
      clear iwhere.
      xwhere = s_where-low.
      append xwhere to iwhere.
    endloop.
    select * up to 100 rows into table itab
              from (p_table)
                    where (iwhere).
    loop at itab.
      write:/ itab.
    endloop.
    Regards
    vasu

  • Passing Flash Variables to ASP

    Hello everyone,
    New problem, I even read other peoples posts. I am working on
    a program that would send a subject to an .asp form, but the
    subject line doesn't want to pass.
    The code that I have in my flash program in the last frame
    is:
    mySendVars = new LoadVars();
    mySendVars.Subject = "Subject Line";
    mySendVars.send("mail.asp", "_self", "POST");
    It is to open the mail.asp form, which it does, but alas, no
    subject line.
    The script that I have to accept the subject line is:
    <% @Language = "VBScript" %>
    <%
    Option explicit
    Response.Buffer= true
    Response.Expires = -1441
    Session("Email")=("[email protected]")
    Session("Subject")
    %>
    <html>
    <head>
    <title><% Response.Write (Session("Subject"))
    %></title>
    <link rel="stylesheet" type="text/css" href="l.css">
    <script LANGUAGE="JavaScript">
    code to process if the form is filled out properly
    <p align="center">You have successfully completed the
    <% Response.Write (Session("Subject")) %>Program.
    To do the evaluation<a href="otherprogram.asp">click
    here</a>.</p>
    The evaluation also opens, but there is no subject
    line....which isn't a surprise if the subject variable isn't
    passing.
    Any help would be appreciated!
    Thank you all in advance!

    I'm working on a similar problem where the asp script won't
    send the email body. What I'm wondering about your problem is
    whether the way you specify the subject ("Subject Line") is an
    instance name or variable of the text field. The asp script I'm
    using utilizes instance names.
    So my question is, do you have the subject text field named
    properly in your Flash movie?

  • Passing local variable to subsequence

    I have a sequence that sets a local variable, Locals.LowPassFreqGhz = 1.800. 
    Then it runs 5 subsequences.
    The Local is set to a new value and then the same 5 subsequences are run again.
    Now I have new model numbers where the pair is different and soon will have models where there will be groups of 4 frequencies instead of two. Therefore I would like to put the 5 seqs into a subseq and pass the freq based on a select statement. In my limited understanding and knowledge of TestStand I think the subsequence would have its own Local.variables. How should I pass this local to a subsequence, convert to a File.global?
    thanx,
    jvh 
    Solved!
    Go to Solution.

    there is another way also to  
    Teststand give us an option of "Propagation" of a  variable to subseqeunce.
    we need to  create a local variable both in main and sub sequence with same name and use "Propogate to subsequence" in main seqeunce and " allowpropagation from caller" in sub seqeunce.
    This option of propagation one can see by right click of a variable in variables pane. This allows us to get the values of variables in main seqeuence to sub seqeunce.
    But need to remember that both variable names in main and sub sequence should be the same.
    Regards,
    Praveen.

  • Reading from select-options field into the internal table

    Hi,
      I have to read the low and high ranges from the select-options fields into a field in the internal table in order to update the same field in line item table. since the user may change the screen fields, i need to pass the values directly from the screen and store it in a variable in the internal table. Is there a way to pass both ranges, low and high to one variable which holds the entire range?
    Thanks,
    Sruthy

    Hi,
    In the Selection screen you can directly read the field(Select-option)value using read statement as follows:
    READ TABLE <SELECT-OPTIONS field name> [using index] INTO <work area>.
    After reading you can directly access all the values as follows and can store them in the variables:
    var1 = <work area>-LOW
    var2 = <work area>-HIGH
    var3 = <work area>-SIGN
    var4 = <work area>-OPTION
    as per your requirement.
    I think this will help you.
    <b>Kindly reward if helpful.</b>
    Regards,
    Shakuntala.

  • Passing Session variable of DATE data type to opaque view filter

    Hi Everyone,
    Can you guys please help me in passing session variable of DATE data type in RPD's physical layer 'opaque view' filter for Oracle database
    I tried following syntax, syntax wise I didn't got getting any error, but at the same time this opaque view is not fetching any records as well. my session variable is "END_DATE" and its value is 1998/12/31:00:00:00(as shown in RPD session windows, datatype is DATETIME)
    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, TIME_ID FROM SH.SALES
    WHERE TIME_ID =TO_DATE( 'VALUEOF(NQ_SESSION.END_DATE)','MM/DD/YYYY')
    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, TIME_ID FROM SH.SALES
    WHERE TIME_ID = TO_DATE( 'VALUEOF(NQ_SESSION."END_DATE")','MM/DD/YYYY')
    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, TIME_ID FROM SH.SALES
    WHERE TRUNC(TIME_ID) = TO_DATE( 'VALUEOF(NQ_SESSION."END_DATE")','MM/DD/YYYY')
    In past, I was able to pass a session variable into a opaque view filter using DATEOF function, but that was in DB2.
    I appreciate your time and help

    Finally, I got right format. here it is
    to_date(substr('valueof(NQ_SESSION.END_DATE)',1,10), 'yyyy-mm-dd')
    and here is the source from where I got this information
    Using OBIEE Session Variables in Select Tables in the Physical Layer

  • How to pass a variable from one class to another class?

    Hi,
    Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
    class A {
      int a;
      int doA() {
          a = a + 1;
          return a;
    class B {
      int b;
      A r = new A();
      r.a;  // error: <identifier> expected. What does that mean ?
      int doB() {
         int c = b/a;  // error: operator / cannot be applied to a
    }Thank you!

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

Maybe you are looking for

  • After ZEN 7 HP3 agent upgrade, inventory not running?

    I didn't notice this until now, but after upgrading the agents on the workstations from 6.5 SP1b, to 7.0 HP3, I'm not getting inventory scans anymore. Inventory IS running and working on the server end (I believe the back- end is 7.0 SP1). I just don

  • Change of configuration in System Information

    Hi, Would change of a configuration in Configuration Manager/Tools/Miscellaneous Tools/System Information require restarting ICM services? Which ones? Thanks, Dilip                  

  • Add Minutes to a Timestamp column

    Hello there, I need to know how to add minutes to a timestamp column in APEX. I was looking for an answer on the internet but the DATEADD function doesn't work in APEX. Any ideas? Ruben

  • Table name for field named URLGR

    hi can anyone pls tell me in which table can i find field named URLGR

  • Java not working

    Hello. For some apps, bunches of dialog box elements are invisible. They don't appear to be there, but if you click in the right place, they activate and perform the right function. If it's a dropdown, the dropdown list appears. A lot of Java apps ex