Results from Executing Sequence in VB

I�m trying to control the TestStand engine from
Visual Basic. I�m using the Automation Server
interface rather than the ActiveX control because
ultimately I want to be able to interface with it
from script running in a web browser.
The problem I'm having is that I can execute a
sequence file but I can't get any meaningful
results out of it. For example the ResultStatus
property of each step in a sequence is blank.
However, when I run the same file in the sample
VB Test Operator program everything seems to work.
I guess it's probably because I'm not handling
the engine's UIMessageHandler properly.
The relevant code is as follows:
Set moTS = New TS.Engine 'using as Automation
Server
'Get a sequence file
Set moSequenceFile = moTS.GetSequenceFile
("c:\program
files\teststand\tutorial\sample2.seq")
'Get the main sequence
Set oSequence = moSequenceFile.GetSequence(0)
SequenceName = oSequence.Name
'Enable polling for UIMessages
moTS.UIMessagePollingEnabled = True
Timer1.Enabled = True
'Start an execution on this sequence, bypassing
the Proces model
Set moExecution = moTS.NewExecution
(moSequenceFile, SequenceName, Nothing, False,
ExecTypeMask_Normal)
'In UIMessage Handler code
Dim UIMsgCode As TS.UIMessageCodes
If Not moTS Is Nothing Then
If moTS.IsUIMessageQueueEmpty Then
Set moUIMsg = moTS.GetUIMessage
UIMsgCode = moUIMsg.Event
Select Case UIMsgCode
Case UIMsg_StartExecution
Case UIMsg_EndExecution
Debug.Print "Num Threads = " &
moExecution.NumThreads
Debug.Print "Execution Status = "
& moExecution.ResultStatus
'Print info about the steps
Set moSequenceFile =
moExecution.GetSequenceFile
Set oSequence =
moSequenceFile.GetSequence(0)
NumSteps = oSequence.GetNumSteps
(StepGroup_Main)
For i = 0 To NumSteps - 1
Set oStep = oSequence.GetStep
(i, StepGroup_Main)
Debug.Print "Name = " &
oStep.Name
Debug.Print "Description = "
& oStep.Description
Debug.Print "Result Status
= " & oStep.ResultStatus 'This is empty
Next
Debug.Print "Report = " &
moExecution.Report.All 'This is empty
Set oSequence = Nothing
Set moThread = Nothing
Timer1.Enabled = False
Case UIMsg_BreakOnUserRequest
Case UIMsg_BreakOnBreakpoint
'etc.
End Select
Set moUIMsg = Nothing
End If
End If
Sent via Deja.com http://www.deja.com/
Before you buy.

Hi Paul,
Thanks for the examples web reference. The simple VB example will be
useful as there's less stuff to wade through! Plus, I'll probably also
eventually need to refer to the C++ examples.
Re: the current problem, I had in the meantime solved it on my own. I'd
done what you say below, but the critical thing I missed was defining
the sequence context object.
Kevin
In article <[email protected]>,
"Paul Mueller" wrote:
>
> Kevin,
>
> You'll need to use a timer callback or some asynchronous technique to
poll
> for UIMessages. Furthermore, you need to release the UIMessage
before TestStand
> will continue with the execution. The execution pauses while you are
handling
> the UIMessage. And the execution continues only when you release the
UIMessage
> (or set it to Nothing).
>
> THere is a Simple VB Operator Interface example on the web at
www.ni.com/support/epd/
>
> Hope this helps,
> Paul
>
> [email protected] wrote:
> >I�m trying to control the TestStand engine from>Visual Basic. I�m
using
> the Automation Server>interface rather than the ActiveX control
because>ultimately
> I want to be able to interface with it>from script running in a web
browser.>>The
> problem I'm having is that I can execute a>sequence file but I can't
get
> any meaningful>results out of it. For example the
ResultStatus>property of
> each step in a sequence is blank.>However, when I run the same file
in the
> sample>VB Test Operator program everything seems to work.>>I guess
it's probably
> because I'm not handling>the engine's UIMessageHandler properly.>>The
relevant
> code is as follows>>Set moTS = New TS.Engine 'using as
Automation>Server>>'Get
> a sequence file>Set moSequenceFile = moTS.GetSequenceFile>
("c:\program>files\teststand\tutorial\sample2.seq")>>'Get
> the main sequence>Set oSequence = moSequenceFile.GetSequence(0)
>SequenceName
> = oSequence.Name>>'Enable polling for
UIMessages>moTS.UIMessagePollingEnabled
> = True>Timer1.Enabled = True>>'Start an execution on this sequence,
bypassing>the
> Proces model>Set moExecution = moTS.NewExecution>(moSequenceFile,
SequenceName,
> Nothing, False,>ExecTypeMask_Normal)>>'In UIMessage Handler code>>Dim
UIMsgCode
> As TS.UIMessageCodes>>If Not moTS Is Nothing Then>> If
moTS.IsUIMessageQueueEmpty
> Then>> Set moUIMsg = moTS.GetUIMessage>> UIMsgCode =
moUIMsg.Event>>
> Select Case UIMsgCode> Case
UIMsg_StartExecution>
> Case UIMsg_EndExecution>> Debug.Print "Num
Threads =
> " &>moExecution.NumThreads> Debug.Print "Execution
Status
> = ">& moExecution.ResultStatus>> 'Print info about the
steps>
> Set moSequenceFile
=>moExecution.GetSequenceFile>
> Set oSequence =>moSequenceFile.GetSequence(0)>>
NumSteps
> = oSequence.GetNumSteps>(StepGroup_Main)>> For i = 0
To NumSteps
> - 1> Set oStep = oSequence.GetStep>(i,
StepGroup_Main)>
> Debug.Print "Name = "
&>oStep.Name>
> Debug.Print "Description = ">& oStep.Description>
Debug.Print
> "Result Status>= " & oStep.ResultStatus 'This is
empty> Next>>
> Debug.Print "Report = " &>moExecution.Report.All 'This
is
> empty> Set oSequence = Nothing> Set
moThread
> = Nothing>> Timer1.Enabled = False>> Case
UIMsg_BreakOnUserRequest>
> Case UIMsg_BreakOnBreakpoint> 'etc.>>
End Select>>
> Set moUIMsg = Nothing>> End If>End If>>>Sent via Deja.com
http://www.deja.com/>Before
> you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.

Similar Messages

  • How to get save result from EXECUTE from a dynamic SQL query in another table?

    Hi everyone, 
    I have this query:
    declare @query varchar(max) = ''
    declare @par varchar(10)
    SELECT @par = col1 FROM Set
    declare @region varchar(50)
    SELECT @region = Region FROM Customer
    declare @key int
    SELECT @key = CustomerKey FROM Customer
    SET @query = 'SELECT CustomerKey FROM Customer where ' + @par + ' = '+ @key+ ' '
    EXECUTE (@query)
    With this query I want get col1 from SET and compare it to the column Region from Customer. I would like to get the matching CustomerKey for it.
    After execution it says commands are executed successfully. But I want to save the result from @query in another table. I looked it up and most people say to use sp_executesql. I tried a few constructions as sampled and I would always get this error: 
    Msg 214, Level 16, State 2, Procedure sp_executesql, Line 12
    Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.
    So the output should be a list of CustomerKeys in another table.
    How can I save the results from EXECUTE into a variable? Then I assume I can INSERT INTO - SELECT in another table. 
    Thanks

    CREATE TABLE Customer
    (CustomerKey INT , Name NVARCHAR(100));
    GO
    INSERT dbo.Customer
    VALUES ( 1, N'Sam' )
    GO
    DECLARE @query nvarchar(max) = ''
    declare @par varchar(10) = 'Name',
    @key varchar(10) = 'Sam'
    CREATE TABLE #temp ( CustomerKey INT );
    SET @query =
    insert #temp
    SELECT CustomerKey
    FROM Customer
    where ' + @par + ' = '''+ @key+ ''' '
    PRINT @query
    EXEC sp_executesql @query
    SELECT *
    FROM #temp
    DROP TABLE #temp;
    DROP TABLE dbo.Customer
    Cheers,
    Saeid Hasani
    Database Consultant
    Please feel free to contact me at [email protected] as well as on Twitter and Facebook.
    [My Writings on TechNet Wiki] [T-SQL Blog] [Curah!]
    [Twitter] [Facebook] [Email]

  • How to export the result from executing sql statement to excel file ?

    HI all,
    Great with Oracle SQL Developer, but I have have a trouble as follwing :
    I want to export the result from executing sql statement to excel file . I do easily like that in TOAD ,
    anyone can help me to do that ? Thanks so much
    Sigmasvn

    Hello Sue,
    I just tried to export to excel with the esdev extension and got java.lang.NumberFormatException. I found the workaround at Re: Windows Multi-language env, - how do I set English for application lang?
    open the file sqldeveloper\jdev\bin\sqldeveloper.conf and add the following two lines:
    AddVMOption -Duser.language=en
    AddVMOption -Duser.country=USyet now my date formats in excel are 'american-style' instead of german. For example 01-DEC-01 so excel does not recognize it as date and therefore I can not simply change the format.
    When export to excel will be native to 1.1 perhaps someone can have a look at this 'feature'
    Regards
    Marcus

  • How to add process model results to the sequence file results?

    After my sequence file runs, I would like to add some additional results using the process model. I need to log my equipment list which is obtained by the process model. Alternatively, I could add a sub-sequence to the end of each of my sequence files for doing this, but that would create maintenance problems if I ever needed to change the way equipment is logged. Does anyone know a way to (1) append process model results to the sequence file results or (2) force each client sequence file to call a sub-sequence before returning to the process model.

    Mark -
    The report and database process model routines expect a single subsequence step result that invoked MainSequence. This result contains the results from the sequence call.
    In TestStand after the process model root sequence call to MainSequence is performed, the property Locals.ResultList[0] is the MainSequence result. The subproperty Locals.ResultList[0].TS.SequenceCall.ResultList contains the results from the steps in MainSequence.
    One option is to create a subsequence call in the process model that logs the equipment info in the results for its steps. The call to the subsequence should not be checked to record results.
    This subsequence would have a parameter called ResultList. The Result type does not exist in the Insert menu, so you can only create the parameter by copying the empty Locals.ResultList and pasting it in the parameters. Then change its type from By Value to By Reference.
    In the setup of the subsequence, add the following steps which do not record results. These steps rename the Locals.ResultList parameter to ResultListOrig, and then create a new Locals.ResultList alias property that really references Parameters.ResultList. This way any additions to the Locals.ResultList really append to the Parameter.ResultList.
    Setup
    Step: "Rename Locals.ResultList"
    StepType, Adapter: Action, Active-X
    Description:
    Action, Set PropertyObject.Name = "ResultListORIG"
    Record Results: False
    Step: "Create Alias in Locals"
    StepType, Adapter: Actioin, Active-X
    Description:
    Action, Call PropertyObject.SetPropertyObject ("ResultList",
    0x201 ' Not Owning and Create, Parameters.ResultList)
    Record Results: False
    In the Main steps, you add your equipment info steps which record results.
    In the Cleanup steps you undo the steps performed in Setup.
    Cleanup
    Step: "Delete Alias in Locals"
    StepType, Adapter: Action, Active-X
    Description:
    Action, Call PropertyObject.DeleteSubProperty ("ResultList",
    0x400 ' Refer to Alias)
    Record Results: False
    Step: "Rename Locals.ResultListORIG"
    StepType, Adapter: Action, Active-X
    Description:
    Action, Set PropertyObject.Name = "ResultList"
    Record Results: False
    I have attached a TS 2.0 version of SequentialModel.Seq that has a AppendResults subsequence in it and this is invoked after MainSequence in Single Pass entry point.
    Hope this helps...
    Scott Richardson (NI)
    Scott Richardson
    National Instruments
    Attachments:
    SequentialModel.Seq ‏174 KB

  • Can we execute sequence not from the 1st frame to end?

    I had a problem that I want to execute sequence not from the 1st frame but from the specific frame that I want to execute to the end. How can I do? Please help me.

    Instead of using a sequence I suggest you use a state machine. By using a state machine you can begin anywhere you like.
    For more information in regards to a state machine, see the following link:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/C74CEC177A289DBD86256C4E00600196?opendocument
    Hope this helps.
    Mike

  • Record Results from sequence call inside of SequenceFilePostStepFailure Callback

    Test Stand 3.1
    When a step fails I use SequenceFilePostStepFailure Callback.
    In there I have prompt:
    1. Continue
    2. Terminate
    3. Terminate (thus calling a power down sequence file)
    Problem is that when Option 3 is used. There are no results recorded from that sequence call because it was invoked from the Callback.
    How do I force record results when that sequence file is called?
    Attachments:
    RecordResultsProblem1.zip ‏10 KB

    Hello Jaws8you,
    After looking into this issue further, it appears as if the link I posted has some great information but is not an exact fit for your particular situation.
    Because results from sequence callbacks will not populate in the report, we need to make sure and have any results we would like included in the main sequence.
    In your case we are just going to put the sequence call in the "Clean Up" tab, which will report the data, and is good programming practice.
    So to fix this problem, let's go ahead and try this:
    1.) Change the variable "Locals.ButtonPressed" to FileGlobals.ButtonPressed in the locations that you have it so far
    2.) "Cut" the "Call Main Power Down" sequence call from the "SequenceFilePostStepFailure" step, and copy it to the "CleanUp Tab" of "Main Sequence"
    Basically, that should be it. What this will do now is run the "Call Main Power Down" sequence when button 3 is pressed and skip this step whenever button 1 or 2 is pressed. The result is then published in the report.
    This should work out the best for you, thanks for posting and have an awesome day!
    With warm regards,
    David D.

  • Last Result from Fulltext SQL Query Search Not Showing

    I am creating a custom search results page for MOSS 2007 (using inline .aspx code - don't ask) that uses Fulltext SQL Queries.  I get the results in a ResultTable (see code below) and then use a DataTable to write code to display it (I could have used
    a DataGrid, I know).
    The problem is that the last result is not showing. So, if it reports that there are 5 results, only 4 will show. I have verified that all 5 results do exist (using a slightly broadened query). If it reports 1 result, none exist in the DataTable that loads
    the result data from the ResultTable.
    FullTextSqlQuery query = new FullTextSqlQuery(site);
    query.ResultTypes = ResultType.RelevantResults;
    query.QueryText = qry;
    query.RowLimit = 50;
    query.StartRow = iPage;
    try
    ResultTableCollection results = query.Execute();
    ResultTable resultTable = results[ResultType.RelevantResults];
    DataTable table = new DataTable();
    table.Load(resultTable, LoadOption.OverwriteChanges);
    int n = resultTable.TotalRows;
    The variable "qry" is a valid SQL Query with the relevant clauses.
    I am using a foreach loop to go through "table" (a DataTable), and so I do not think that I have a "one-off error".
    Any suggestions would be most welcome.

    So in results you have all items but when you are loading it into table (type DataTable) you are loosing one last record.
    1) First you check what data you are getting in resultTable - as you are specifying RelevantResult
    2) Check last index of data in ResultTable collection and try to find out the last index ResultTable, or try to find last index of data in result table
    DataTable.Load method accepts parm of type IDataReader and IDatareader, there are cases it looses records if not read properly..check below links
    http://stackoverflow.com/questions/8396656/why-does-my-idatareader-lose-a-row
    http://msdn.microsoft.com/en-us/library/system.data.datatable.load(v=vs.110).aspx
    <hr> Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL <br/> <b><a href="http://insqlserver.com">Everything about SQL Server | Experience inside SQL Server </a></b>-<a href="http://insqlserver.com">Mohammad
    Nizamuddin </a>

  • Copy the result of Execute immediate result into a variable.

    Hi All,
    Is there any way to copy the result of execute immediate result into a variable.
    am doing following steps but am getting an error.
    varSQLstmt1:='select count(*) into'||vararch_ct||' from '||vararch_count;
    dbms_output.put_line(varSQLstmt1);
    execute immediate varSQLstmt1;
    But am getting sql statement as select count(*) into from SALES
    the variable(vararch_ct) is missing in select statement .
    please help me to solve this issue. Or is there any way to insert the count of records into any variable.
    Thanks
    Sree

    declare
    varSQLstmt1    varchar2(4000);
    v_count          number;
    begin
    varSQLstmt1:='select count(*) from '||vararch_count;
    dbms_output.put_line(varSQLstmt1);   
    execute immediate varSQLstmt1 into v_count;
    dbms_output.put_line('Coutn :: ' || v_count);
    end;

  • Odd results from SQL statement in JSP

    Hi.
    Getting very strange results from my SQL statement housed in my JSP.
    the last part of it is like so:
    "SELECT DISTINCT AID, ACTIVE, REQUESTOR_NAME, ..." +
    "REQUESTOR_EMAIL" +
    " FROM CHANGE_CONTROL_ADMIN a INNER JOIN CHANGE_CONTROL_USER b " +
    "ON a.CHANGE_CTRL_ID = b.CHANGE_CTRL_ID " +
      " WHERE UPPER(REQUESTOR_NAME) LIKE ? ";   I've set the following variables and statements:
    String reqName = request.getParameter("requestor_name");
    PreparedStatement prepstmt = connection.prepareStatement(preparedQuery);
    prepstmt.setString(1, "%" + reqName.trim().toUpperCase() + "%");
    ResultSet rslts = prepstmt.executeQuery();
    rslts.next();
    int aidn = rslts.getInt(1);          
    int actbox = rslts.getInt(2);     String reqname = rslts.getString(3).toUpperCase();
    String reqemails = rslts.getString(4);
    String bizct = rslts.getString(5);
    String dept = rslts.getString(6);
    String loc = rslts.getString(7);
    Date datereq = rslts.getDate(8);
    String busvp = rslts.getString(9);
    AND SO ONSo then I loop it, or try to with the following:
    <%
      try {
      while ((rslts).next()) { %>
      <tr class="style17">
        <td><%=reqname%></td><td><%=reqemails %></td><td><%=bizct %></td>td><%=dept %></td>
       <td><%=aidn %></td>
      </tr>
      <%
    rslts.close();
    selstmt.close();
    catch(Exception ex){
         ex.printStackTrace();
         log("Exception", ex);
    %>AND so on, setting 13 getXXX methods of the 16 cols in the SQL statement.
    Trouble is I'm getting wildly inconsistent results.
    For example, typing 'H' (w/o quotes) will spit out 20 duplicate records of a guy named Herman, with the rest of his corresponding info correct, just repeated for some reason.
    Typing in 'He' will bring back the record twice (2 rows of the complete result set being queried).
    However, typing in 'Her' returns nothing. I could type in 'ell' (last 3 letters of his name, Winchell) and it will again return two duplicate records, but typing in 'hell' would return nothing.
    Am I omitting something crucial from the while statement that's needed to accurately print out the results set without duplicating it and that will ensure returning it?
    There's also records in the DB that I know are there but aren't being returned. Different names (i.e. Jennifer, Jesse, Jeremy) won't be returned by typing in partial name strings like Je.
    Any insight would be largely appreciated.
    One sidenote: I can go to SQL Plus and accurately return a results set through the above query. Having said that, is it possible the JDBC driver has some kind of issue?
    Message was edited by:
    bpropes20
    Message was edited by:
    bpropes20

    Am I omitting something crucial from the while
    statement that's needed to accurately print out the
    results set without duplicating it and that will
    ensure returning it?Yes.
    In this code, nothing ever changes the value of reqname or any of the other variables.
      while ((rslts).next()) { %>
      <tr class="style17">
        <td><%=reqname%></td><td><%=reqemails %></td><td><%=bizct %></td>td><%=dept %></td>
       <td><%=aidn %></td>
      </tr>
      <%
    } You code needs to be like this:while (rslts.next()) {
      reqname = rslts.getString(3).toUpperCase();
      reqemails = rslts.getString(4);
      bizct = rslts.getString(5);
      dept = rslts.getString(6);
      loc = rslts.getString(7);
      datereq = rslts.getDate(8);
      busvp = rslts.getString(9);
    %>
      <tr class="style17">
        <td><%=reqname%></td><td><%=reqemails %></td><td><%=bizct %></td>td><%=dept %></td>
       <td><%=aidn %></td>
      </tr>
      <%
    There's also records in the DB that I know are there
    but aren't being returned. Different names (i.e.
    Jennifer, Jesse, Jeremy) won't be returned by typing
    in partial name strings like Je.Well, you're half-right, your loop won't display all the rows in the result set, because you call rslts.next(); once immediately after executing the query. That advance the result set to the first row; when the loop is entered, it starts displaying at the 2nd row (or later if there are more next() calls in the code you omitted).

  • Referring to Automator Results from Previous Steps

    Is it possible to refer to the results from previous steps in an Automator Workflow? Specifically, I'm trying to modify my backup Workflow to remove files from a folder before archiving it. I'm writing code and I want to back up my progress every so often. I have a decent workflow for archiving my entire project folder, but my executable is 21 MB where as the source code is .5 MB. I could cut the size of my archive dramatically if I could remove the executable file before archiving (plus it's obviously nonportable and redundant anyhow). I'm running into 2 issues when trying to create a Workflow to handle this:
    1) Find/Filter Finder Items rely on Spotlight meta tags. Since I'm constantly recreating the executable, it appears Spotlight generally doesn't have the executable indexed so these two functions don't work. They simply don't see the executable.
    2) Even if I find the file and delete it, I don't know how to select the folder again to archive it. I'm trying to keep this general so it'll work on any project folder so I don't want to point it directly to the folder.

    Is it possible to refer to the results from previous steps in an Automator Workflow? Specifically, I'm trying to modify my backup Workflow to remove files from a folder before archiving it. I'm writing code and I want to back up my progress every so often. I have a decent workflow for archiving my entire project folder, but my executable is 21 MB where as the source code is .5 MB. I could cut the size of my archive dramatically if I could remove the executable file before archiving (plus it's obviously nonportable and redundant anyhow). I'm running into 2 issues when trying to create a Workflow to handle this:
    1) Find/Filter Finder Items rely on Spotlight meta tags. Since I'm constantly recreating the executable, it appears Spotlight generally doesn't have the executable indexed so these two functions don't work. They simply don't see the executable.
    2) Even if I find the file and delete it, I don't know how to select the folder again to archive it. I'm trying to keep this general so it'll work on any project folder so I don't want to point it directly to the folder.

  • Results from SQL_TRACE

    Hello -
    I have the following results from running a SQL_Trace for a session. The first Insert statement uses all bind variables, so it's executed 785 times with 0 missed parses in the Library Cache. The second Insert statement does not use bind variable for two date columns, so this Insert statement is executed anywhere from 1 to 4 times, but there are hundreds of these Insert statements in my trace file. Should performance improve if the second statement uses bind variables for the date columns?
    Thanks.
    1. Insert statement that uses all bind variables:
    insert into SERVICE_EVENT (ACT_UID, SEV_SEQ_NO, RPCS_SOURCE_NM,
    SEV_FUNCTION_XX, CLIENT_NM, SEV_HOST_NM, SEV_CICS_TASK_ID, SEV_RECEIVE_TS,
    SEV_SEND_TS, SEV_SEND_BYTE_CT, SEV_RECEIVE_BYTE_CT, SEV_G_MESSAGE_XX,
    SEV_A_MESSAGE_XX, SERVICE_NM, SEV_SERVER_NM, ORGANIZATION_NM,
    APPLICATION_ID, RPC_SEQ_NO)
    values
    (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18)
    call count cpu elapsed disk query current rows
    Parse 0 0.00 0.00 0 0 0 0
    Execute 785 0.18 0.19 0 681 5210 785
    Fetch 0 0.00 0.00 0 0 0 0
    total 785 0.18 0.19 0 681 5210 785
    2. Insert statement that does not use bind variables for the data columns:
    insert into SERVICE_EPISODE (ACT_UID, SE_SERVER_NM, SE_REQ_BYTE_CT,
    SE_RESP_BYTE_CT, SE_REQ_XML_XX, SE_RESP_XML_XX, SVX_XML_STYLE_NM,
    ORGANIZATION_NM, APPLICATION_CD, CLIENT_REQ_ID, DURATION_MS, STATUS_CD,
    SE_REQ_USER_ID, SE_REQ_RACF_IDS, SE_REQ_TS, SE_RESP_TS)
    values
    (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,TO_DATE('05/18/05 16:31:17',
    'MM/DD/YY HH24:MI:SS'), TO_DATE('05/18/05 16:31:17','MM/DD/YY HH24:MI:SS'))
    call count cpu elapsed disk query current rows
    Parse 2 0.00 0.00 0 0 0 0
    Execute 2 0.00 0.00 0 4 45 2
    Fetch 0 0.00 0.00 0 0 0 0
    total 4 0.00 0.00 0 4 45 2

    Should performance improve if the second statement uses bind variables for the date columns? Probably, it depends on how expense the parse is compared to the rest of teh query execution. But generally, if you've got hundreds of statements which are the same except for literals then it's usually a good idea to replace them with a statement that uses bind variables. The best thing to do is benchmark it.
    Cheers, APC

  • Can I desplay numeric results as a sequence is running?

    The default sequence display just shows pass/fail.  I would like to show the numeric results to the operator as the test is running.  What I would like to do is to build a long string with one line per test, and display this string as it gets built.  Is this possible using the custom UI?

    Yes you will have to customize the UI.  There is a ton of stuff on NI's website regarding this.  You need to look for UIMessage.  Here are some sites to get you started:
    http://zone.ni.com/devzone/cda/tut/p/id/4532
    http://zone.ni.com/devzone/cda/tut/p/id/7560  Look under the Communication from the Test to the User Interface section
    http://zone.ni.com/reference/en-XX/help/370052J-01​/tsapiref/reftopics/uimessage/  This is also in the help
    If you dig around you'll find more.  The idea is that from your sequence you post a message with information.  Then once the message gets posted your UI will pick it up as an event and you create some sort of handler to either display or utilize that data.  The tricky part is creating the handler.  I believe in some of the course material there was exercises that did just this.
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Inconsistent Results from dbms_output.get_lines

    Hi,
    I am getting inconsistent results from using dbms_output.get_lines.
    I'm using get_lines in a procedure A that executes a function B to test if the function returns 0 or > 0 to indicate validity of my data. In that function, I use dbms_output.put_lines to communicate data points that I want to use. My procedure A does a get_lines after executing function B then either logs the lines into a table or sends an email.
    Right now, get_lines is behaving sporadically for me. Sometimes I the chararr returns some lines while other times it doesn't. The strange thing is numlines does return a value, and it's the value that I expected.
    Can someone please help?
    Thanks.

    Use parameters or even global package variables to transport data from one procedure to the other. dbms_output is not meant for this, it will not work.

  • Inconsistent results from CallableStatement

    We are getting inconsistent results from a call to an Oracle database. We have a CallableStatement that returns 4 INTEGERs.
    It runs perfectly if I run the Oracle procedure directly from the sql command line and then call it from the java code.
    However if I recompile the Oracle stored procedures and execute the Callable Statement (without first running it from sql) then I am getting incorrect results...1,2,1,1 is being returned instead of 1,2,0,3. Are these results being cached somewhere???
    We are using Oracle 8.1.7, JDK 1.3.1, and Oracle thin driver 8.1.7.
    The code is as follows:
    <pre>
    private CallableStatement autoLBNumbersNeeded;
    private void prepareStatements(){
         autoLBNumbersNeeded=dbConnection.prepareCall("{CALL
         pkg_scheduler.pr_auto_lb_nos(?,?,?,?)}");
         autoLBNumbersNeeded.clearParameters();
         autoLBNumbersNeeded.registerOutParameter(1, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(2, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(3, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(4, java.sql.Types.INTEGER);
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    </pre>
    The Oracle procedure is
    <pre>
    PROCEDURE proc1( p_parm_1 OUT NUMBER, p_parm_2 OUT NUMBER, p_parm_3
    OUT NUMBER, p_parm_4 OUT NUMBER)
    AS
    BEGIN
    -- Get Counts
    SELECT COUNT(*)
    INTO p_parm_1
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_2
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_3
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_4
    FROM blah ......
    EXCEPTION
    blah .......
    END proc1;
    </pre>
    Can anyone help?
    Many thanks
    Fionnuala

    Hi
    Yes I have a debug line that prints them out in the doAutoLoadBalancing method - this is the point where I am diagnosing the problem. It only prints the correct results after I have already run the procedure from the SQL command line.
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    if (m_cat.isDebugEnabled()) {m_cat.debug("mwFF: "+mwFF+"; mwHF: " +mwHF+"; wmFF: "+wmFF+"; wmHF: "+wmHF);}
    </pre>

  • Web services and ADF 11g- get Result from backing bean

    I'm executing an action from backing bean (call Web service that returns complex data types)
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("unesiPonudu");
    Object result = operationBinding.execute();
    result is instance of oracle.adf.model.adapter.dataformat.XMLHandler$DataCollection but DataCollection is not accessible.
    How to get results from method?
    Tnx,
    Andreja

    Hi,
    there should be a result iterator in the Executables section which cotnains the result. If not, create it from the WS result entry in the DC palette. Once this iterator gets updated, you get the data from this iterator as it would be the case of a table accesses the WS
    Frank

Maybe you are looking for

  • Sending Files from a server to a client (PrintWriter)

    I've only been using Java for a few months and this may be in the wrong forum (sorry if it is)... but I've run into a bit of a problem. I've recently been asked to create Excel files using database records and output a file (HTML table) to a client's

  • MacBook no longer able to access Time Capsule

    I have a MacBook and a G4 hooked up (wirelessly and via Ethernet respectively)to a 802.11n TC, purchased in Nov/08. Both computers had been backing up faithfully but recently, the MacBook does not recognize the TC. When I run the Airport Utility, it

  • Aperture library won't load!

    All of a sudden I am getting the message: The library in "/Users/`/Pictures/Aperture Library.aplibrary" cannot be loaded because it is from a newer version of Aperture, so I can't run Aperture. I am running V 3.02 I haven't changed anything at all, s

  • Sapscript PO MEDRUCK total amount including condition charges

    Hie gurus , i need your help with  a sapscript  Purchase order  Medruck, i can't find the variable which contains PO total that includes condition charges, (e.g Freight charge , discount and customs). i am just getting an amount that does not include

  • Log data when signal is for at least one hour stable

    All, can you please help me out with the following; I have data to log when one signal is for at least one hour between two values. If this is the case, all the data can be kept. If this is not the case, let's say after 30min that one signal is out o