Result from reentrantly called subvi

I have a subvi that I am calling reentrantly, I need to pass a cluster result back.  Doesn't look like I am doing it right because I am not getting any results.  
Image resultfromsubvi.png I am calling the subvi.
Other image is from the subvi in which I bundle the double's up.  I know that I have the same value going into 3.
Just testing.
Thanks in advance.  
Attachments:
resultfromsubvi.png ‏13 KB
resultfromsubvi-2.jpg ‏11 KB

tartar813 wrote:
I am reviewing how to pass the indicator reference to the subvi to update it from the subvi. 
Do you think that would work?
Well sorta.  Again I don't know the full story and how this is intended to be used.  But yes that is one option is to pass the reference to the UI control to each reentrant sub VI.  The issue you will run into is these reentrant subvis will be updating the UI control asyncronously so indicator will be constantly overwritten with new data.  If you plan on logging the data as it comes in you will run into issues keeping track of what data came from where and when.  If you don't care about this type of thing then a control reference maybe the easiest.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

Similar Messages

  • 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.

  • Inconsistent results from database calls

    Hi all I was wondering if anyone would be able to come up with some possible ideas as to why my application is inconsistently retrieving data from a database. I have an application that is pulling information from a database. These calls can be made repetitively pulling the same information over and over again. The quandry that I am faced with is why the application would pull the right data most of the time, but occasionally not pull the correct values.
    I have consided the following:
    blocking - all of the calls are read only and scroll insensitive so I doubt this is the case
    Limited number of connections
    Seems like apossibility but then I would expect an error to be thrown.
    Actions happening to fast
    I was thinking perhaps the cycle is completing before everything has had a chance to finish the last set - is that a possibility ?
    I can't post the code, so I am just looking for any general thoughts or ideas on the topic, if nothing thanks anyways.

    Thank you both for your thoughts. The transactions is definately not a possibility (at least as I understand) as this is on read information only, there is no commits nor any updates being completed by this method.
    I will continue to hunt down this little bugger. The biggest issue is that it is one behemoth of a method that should not exist, but unfortunately does.

  • XML as result from webService call from JSP

    I have a jsp page, where I will invoke a WebService call, which will return
              a big XML object back to me, of which I need to select few key-value pair as
              display item in a table only as result.
              Any idea how to achieve this,
              Thanks & have a nice day!
              Vikky

    I have a jsp page, where I will invoke a WebService call, which will return
              a big XML object back to me, of which I need to select few key-value pair as
              display item in a table only as result.
              Any idea how to achieve this,
              Thanks & have a nice day!
              Vikky

  • 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>

  • Result from measurement

    Where does Teststand put the result from the calling module ? I've written a number of steps in TS 3.1 using the LV7.1 prototype adapter. All my step valuations are 0 ! I assume when I create the "Specify a module step" I have to "wire" the resulting measurement to something in the TS window. Some variable like "step.results...."

    TestStand puts the result where you tell it to put it. When you select "Specify Module", The VI's outputs are displayed. In the value column, you need to specify which TesStand variable to assign to each output of the VI. If you have a single numeric output, you can assign it to step.result.numeric (click on the f(x) button), but you can assign it to any variable you have defined. As part of the TestStand Bookshelf (help menu), is the pdf file called Using LabVIEW with TestStand. You should read this for additonal details.

  • How to add results to report from sequence call disabled in report options ?

    Hello,
    I need to add text to report from a sequence called by a sequence call. The record results option for the sequence call is disabled because the sequence call is normally done thousands of times. Therefore, I don't want to fill in useless text in the report. But, if a certain condition in called sequence fulfills, I would put a text into the report. (Yes, this is related to a sporadic communication problem with the instrument which I want to record into the report.) Which options I have ?
    I have attached an example which doesn't add the text from the sequence to the report.
    Regards,
    Petri
    Attachments:
    report test.seq ‏45 KB

    Hello Ray,
    I encounter same behaviour with NONE adapter action step with post-expression as with a statement step as in my first example. With other words, if record results in sequence call in mainsequence is disabled, I cannot get any records into the report.
    Attached a modified sequence using NONE adapter action.
    Regards,
    Petri
    Attachments:
    report test.seq ‏53 KB

  • Need HELP to pass results from procedure

    Hey Gurus,
    I need your help. I got a package (test) and inside the package two procedures (step1, step2). Now I want to pass the results from the procedure step1 (stat_rec.lev, stat_rec.chi_sq, stat_rec.chi_sig) to the other procedure step2 and make a select with where-clause. How can I manage this?? Got someone a idea??
    Here my package:
    CREATE OR REPLACE PACKAGE test1
    AS
    PROCEDURE step1(table_in IN VARCHAR2, column1 IN VARCHAR2,column2 IN VARCHAR2);
    TYPE stat_tab_rec IS RECORD(lev NUMBER, chi_sq NUMBER, chi_sig NUMBER, rank NUMBER);
    stat_rec stat_tab_rec;
    PROCEDURE step2(table_in IN VARCHAR2, column1 IN VARCHAR2,column2 IN VARCHAR2);
    END test1;
    Thanks for your help!!
    CREATE OR REPLACE PACKAGE BODY test1
    AS
    PROCEDURE step1(table_in IN VARCHAR2, column1 IN VARCHAR2,column2 IN VARCHAR2,column3 IN VARCHAR2,column4 IN VARCHAR2,column5 IN VARCHAR2)
    IS
    TYPE cur_crosstab IS REF CURSOR;
    cur_cross cur_crosstab;
    BEGIN
    OPEN cur_cross FOR 'WITH '
    ||'att_grp AS '
    ||'(SELECT '||column1||' as x1 , lev AS lev, '||column2||', '
    ||' CASE'
    ||' WHEN '||column2||' <= lev '
    ||' THEN 1 '
    ||' ELSE 2 '
    ||'END attribute_group '
    ||'FROM '||table_in||', '
    ||'(SELECT level AS lev '
    ||'FROM dual '
    ||'WHERE level >= (SELECT MIN('||column2||') FROM '||table_in||') CONNECT BY level <= (SELECT MAX('||column2||') FROM '||table_in||'))) '
    ||'SELECT lev, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS''),4) AS chi_square, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_SIG''),4) AS significance, '
    ||'dense_rank() over (order by ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS'' ),4) DESC) AS rank '
    ||'FROM att_grp '
    ||'GROUP BY lev '
    ||'ORDER BY lev';
    LOOP
    FETCH cur_cross INTO stat_rec;
    EXIT WHEN cur_cross%NOTFOUND;
    IF stat_rec.rank = 1 THEN
    DBMS_OUTPUT.put_line(column2);
    DBMS_OUTPUT.put_line(stat_rec.lev|| ' = ' || TO_CHAR(stat_rec.chi_sq,'99.99') || TO_CHAR(stat_rec.chi_sig,'99.99'));
    END IF;
    END LOOP;
    CLOSE cur_cross;
    END step1;
    PROCEDURE step2
    IS
    BEGIN
    END step2;
    END test1;

    Thank you Massimo. I tried your example but I recieve an error: PLS-00306: wrong number or types of arguments in call to "procedure1"
    Here my Codes:
    CREATE OR REPLACE TYPE stat_obj IS OBJECT(zeilen NUMBER,lev NUMBER, chi_sq NUMBER, chi_sig NUMBER);
    CREATE OR REPLACE TYPE stat_tab IS TABLE OF stat_obj;
    CREATE OR REPLACE PROCEDURE procedure1(table_in IN VARCHAR2,column1 IN VARCHAR2,column2 IN VARCHAR2, v OUT stat_tab)
    IS
    TYPE cur_crosstab IS REF CURSOR;
    cur_cross cur_crosstab;
    TYPE stat_tab_rec IS RECORD(lev NUMBER, chi_sq NUMBER, chi_sig NUMBER);
    stat_rec stat_tab_rec;
    BEGIN
    OPEN cur_cross FOR 'WITH '
    ||'att_grp AS '
    ||'(SELECT '||column1||' as x1 , lev AS lev, '||column2||', '
    ||' CASE'
    ||' WHEN '||column2||' <= lev '
    ||' THEN 1 '
    ||' ELSE 2 '
    ||'END attribute_group '
    ||'FROM '||table_in||', '
    ||'(SELECT level AS lev '
    ||'FROM dual '
    ||'WHERE level >= (SELECT MIN('||column2||') FROM '||table_in||') CONNECT BY level <= (SELECT MAX('||column2||') FROM '||table_in||'))) '
    ||'SELECT lev, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS''),4) AS chi_square, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_SIG''),4) AS significance, '
    ||'dense_rank() over (order by ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS'' ),4) DESC) AS ranking '
    ||'FROM att_grp '
    ||'GROUP BY lev '
    ||'ORDER BY lev';
    LOOP
    FETCH cur_cross INTO v;
    EXIT WHEN cur_cross%NOTFOUND;
    --IF v_stat_tab.rank = 1 THEN
    --DBMS_OUTPUT.put_line(v_stat_tab.lev || '=' || TO_CHAR(v_stat_tab.chi_sq,'99.99') || TO_CHAR (v_stat_tab.chi_sig,'99.99'));
    --END IF;
    END LOOP;
    CLOSE cur_cross;
    END;
    CREATE OR REPLACE PROCEDURE procedure2
    IS
    v_zeilen NUMBER;
    v_lev NUMBER;
    v_chi_sq NUMBER;
    v_chi_sig NUMBER;
    v stat_tab;
    BEGIN
    procedure1(v);
    SELECT zeilen,lev,chi_sq,chi_sig INTO v_zeilen,v_lev,v_chi_sq,v_chi_sig
    from table(v);
    DBMS_OUTPUT.put_line(v_zeilen||v_lev||v_chi_sq||v_chi_sig);
    END;
    Hope u can help me!!

  • 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).

  • Problem Obtaining multiple results from MySql Stored Proc via JDBC

    I've spent alot of time on this and I'd be really grateful for anyones help please!
    I have written a java class to execute a MySQL stored procedure that does an UPDATE and then a SELECT. I want to handle the resultset from the SELECT AND get a count of the number of rows updated by the UPDATE. Even though several rows get updated by the stored proc, getUpdateCount() returns zero.
    It's like following the UPDATE with a SELECT causes the updatecount info to be lost. I tried it in reverse: SELECT first and UPDATE last and it works properly. I can get the resultset and the updatecount.
    My Stored Procedure:
    delimiter $$ CREATE PROCEDURE multiRS( IN drugId int, IN drugPrice decimal(8,2) ) BEGIN UPDATE drugs SET DRUG_PRICE = drugPrice WHERE DRUG_ID > drugId; SELECT DRUG_ID, DRUG_NAME, DRUG_PRICE FROM Drugs where DRUG_ID > 7 ORDER BY DRUG_ID ASC; END $$
    In my program (below) callablestatement.execute() returns TRUE even though the first thing I do in my stored proc is an UPDATE not a SELECT. Is this at odds with the JDBC 2 API? Shouldn't it return false since the first "result" returned is NOT a resultset but an updatecount? Does JDBC return any resultsets first by default, even if INSERTS, UPDATES happened in the stored proc before the SELECTs??
    Excerpt of my Java Class:
    // Create CallableStatement CallableStatement cs = con.prepareCall("CALL multiRS(?,?)"); // Register input parameters ........ // Execute the Stored Proc boolean getResultSetNow = cs.execute(); int updateCount = -1; System.out.println("getResultSetNow: " +getResultSetNow); while (true) { if (getResultSetNow) { ResultSet rs = cs.getResultSet(); while (rs.next()) { // fully process result set before calling getMoreResults() again! System.out.println(rs.getInt("DRUG_ID") +", "+rs.getString("DRUG_NAME") +", "+rs.getBigDecimal("DRUG_PRICE")); } rs.close(); } else { updateCount = cs.getUpdateCount(); if (updateCount != -1) { // it's a valid update count System.out.println("Reporting an update count of " +updateCount); } } if ((!getResultSetNow) && (updateCount == -1)) break; // done with loop, finished all the returns getResultSetNow = cs.getMoreResults(); }
    The output of running the program at command line:
    getResultSetNow: true 28, Apple, 127.00 35, Orange, 127.00 36, Bananna, 127.00 37, Berry, 127.00 Reporting an update count of 0
    During my testing I have noticed:
    1. According to the Java documentation execute() returns true if the first result is a ResultSet object; false if the first result is an update count or there is no result. In my java class callablestatement.execute() will return TRUE if in the stored proc the UPDATE is done first and then the SELECT last or vica versa.
    2. My java class (above) is coded to loop through all results returned from the stored proc in succession. Running this class shows that any resultsets are returned first and then update counts last regardless of the order in which they appear in the stored proc. Maybe there is nothing unusual here, it may be that Java is designed to return any Resultsets first by default even if they didn't happen first in the stored procedure?
    3. In my stored procedure, if the UPDATE happens last then callablestatement.getUpdateCount() will return the correct number of updated rows.
    4. If the UPDATE is followed by a SELECT (see above) then callablestatement.getUpdateCount() will return ZERO even though rows were updated.
    5. I tested it with the stored proc doing SELECT - UPDATE - SELECT and again getUpdateCount() returns ZERO.
    6. I tested it with the stored proc doing SELECT - UPDATE - SELECT - UPDATE and this time getUpdateCount() returns the number rows updated by the last UPDATE and not the first.
    My Setup:
    Mac OS X 10.3.9
    Java 1.4.2
    mysql database 5.0.19
    mysql-connector 5.1.10 (connector/J)
    Maybe I have exposed a bug in JDBC?
    Thanks for your help.

    plica10 wrote:
    Jschell thank you for your response.
    I certainly don't mean to be rude but I often get taken that way. I like to state facts as I see them. I'd love to be proved wrong because then I would understand why my code doesn't work!
    Doesn't matter to me if you are rude or not. Rudeness actually makes it more entertaining for me so that is a plus. Nothing I have seen suggests rudeness.
    In response to your post:
    When a MySql stored procedure has multiple sql statements such as SELECT and UPDATE these statements each produce what the Java API documentation refers to as 'results'. A Java class can cycle through these 'results' using callableStatement dot getMoreResults(), getResultSet() and getUpdateCount() to retrieve the resultset object produced by Select queries and updateCount produced by Inserts, Deletes and Updates.
    As I read your question it seems to me that you have already proven that it does not in fact do that?
    You don't have to read this but in case you think I'm mistaken, there is more detail in the following website under the heading 'Using the Method execute':
    http://docsrv.sco.com/JDK_guide/jdbc/getstart/statement.doc.html#1000107
    Sounds reasonable. But does not your example code prove that this is not what happens for the database and driver that you are using?
    Myself I dont trust update counts at all since, in my experience some databases do not return them. And per other reports sometimes they don't return the correct value either.
    So there are two possibilities - your code is wrong or the driver/database does not do it. For me I would also question whether in the future the driver/database would continue to behave the same if you did find some special way to write your SQL so it does do it. And of course you would also need to insure that every proc that needed this would be written in this special way. Hopefully not too many of those.
    So this functionality is built into java but is not in common use amongst programmers. My java class did successfully execute a stored proc which Selected from and then finally Updated a table. My code displayed the contents of the Select query and told me how many rows were affected by the update.
    It isn't "built into java". It isn't built into jdbc either. If it works at all then the driver and by proxy the database are responsible for it. I suspect that you would be hard pressed to find anything in the JDBC spec that requires what that particular link claims. I believe it is difficult to find anything that suggests that update counts in any form are required.
    So you are left with hoping that a particular driver does do it.
    I suppose it is rare that you would want to do things this way. Returning rowcounts in OUT parameters would be easier but I want my code to be modular enough to cover the situation where a statement may return more than one ResultSet object, more than one update count, or a combination of ResultSet objects and update counts. The sql may need to be generated dynamically, its statements may be unknown at compile time. For instance a user might have a form that allows them to build their own queries...
    Any time I see statements like that it usually makes me a bit uncomfortable. If I am creating data layers I either use an existing framework or I generate the code. For the latter there is no generalization of the usage. Every single operation is laid out in its own code.
    And I have in fact created generalized frameworks in the past before. I won't do it again. Benefits of the other idioms during maintenance are too obvious.

  • Retrieve WRITE statements of a called report from a caller one: howto?

    Hi experts, need an help for a (imho) quite interesting task. I have a little report that works on a single purchase order and , at the end of the execution, prints on screen a simple message using a WRITE statement. (something like "PO number X processed with/without errors", and eventually other lines showing a specific error).
    Now, I'm just creating a "caller" report that gets po numbers from an input file, and process them one by one; a really simple task, but considering I'd like not to modify the original "called" program, I'm wondering about how to get messages in order to print them on screen at the end of the loop.
    I tried something as follows (note: it_orders is an internal table containing my po numbers):
      LOOP AT it_orders.
        CLEAR listobject. "TYPE TABLE OF ABAPLIST
        SUBMIT MY_CALLED_REPORT
          WITH num_ctr = it_orders-ebeln
          WITH flag = flag
          EXPORTING LIST TO MEMORY AND RETURN.
    * read from memory
        CALL FUNCTION 'LIST_FROM_MEMORY'
         TABLES
           LISTOBJECT = LISTOBJECT
         EXCEPTIONS
           NOT_FOUND  = 1
           OTHERS     = 2.
        LOOP AT LISTOBJECT INTO wa_list.
          APPEND wa_list TO FINALLIST.
        ENDLOOP.
      ENDLOOP.
      FORMAT INTENSIFIED COLOR = 1. "heading
      WRITE: 'RESULTS'.
      SKIP.
    * write to output
      CALL FUNCTION 'WRITE_LIST'
    * EXPORTING
    *   WRITE_ONLY       = 'X'
       TABLES
         LISTOBJECT       = FINALLIST
       EXCEPTIONS
         EMPTY_LIST       = 1
         OTHERS           = 2.
    But... it doesn't work. The above code only shows the message of the first order processed, but I can't understand why. Can somebody give a "clean" way to solve this issue? It would be helpful in many cases similar to the one I'm working on
    Thanks in advance

    Thanks *DP, it almost worked for me. There's a little problem anyway; the first row in the output screen is the one of the last call of the REPORT called by a submit. To show it clearly, here's an example: suppose I've got 4 purchase orders to process, stored in an itab 'po_table': 300000001, 300000002, 300000003 and 300000004.
    Then the output of the trace is the following:
    Cancellazione totale dal DB                                                                       
    PO  3000001145  processed correctly.     
    10.03.2009                                                                               
    PO  3000001143  processed correctly.     
    10.03.2009                                                                               
    PO  3000001144  processed correctly.     
    10.03.2009                                                                               
    PO  3000001145  processed correctly.     
    10.03.2009
    As you can see, the original output of the last call of the 'inner' report is visible on top. How can I suppress the output of the called program in order to avoid this replication? Thanks in advance.
    Nvrmind, my fault. Works correctly now, thanks
    Edited by: Matteo Montalto on Mar 10, 2009 10:01 AM

  • 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

  • Return results from ADEP in AS3 Arrays, not ArrayCollections

    Hi all,
    Is there any way to force ADEP to return results from data services in simple AS3 Arrays, not ArrayCollections? Here are my situation:
    In my project I use ADEP Data Management Services. To connect to ADEP services we use RTMP channel defined in services-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
         <services>
              <service-include file-path="remoting-config.xml" />
              <service-include file-path="proxy-config.xml" />
              <service-include file-path="messaging-config.xml" />
              <service-include file-path="data-management-config.xml" />
              <service-include file-path="managed-remoting-config.xml" />
              <service class="fiber.data.services.ModelDeploymentService" id="model-deploy-service" />
              <default-channels>
                   <channel ref="my-rtmp"/>
              </default-channels>
         </services>
         <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel">
              <endpoint url="rtmp://{server.name}:1000" class="flex.messaging.endpoints.RTMPEndpoint"/>
              <properties>
                   <idle-timeout-minutes>20</idle-timeout-minutes>
                   <block-rtmpt-polling-clients>true</block-rtmpt-polling-clients>
                   <rtmpt-poll-wait-millis-on-client>0</rtmpt-poll-wait-millis-on-client>
              </properties>
         </channel-definition>
    </services-config>
    To manage data in database we defined data services in data-management-config.xml like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="data-service" class="flex.data.DataService">
        <adapters>
            <adapter-definition id="java-dao" class="flex.data.adapters.JavaAdapter"/>
            <adapter-definition id="mr-java-dao" class="flex.data.adapters.ManagedRemotingDataAdapter" />
            <adapter-definition id="actionscript" class="flex.data.adapters.ASObjectAdapter" default="true"/>
        </adapters>
        <default-channels>
            <channel ref="my-rtmp"/>
        </default-channels>
        <destination id="SomeProduct.SomeItems">
            <adapter ref="java-dao" />
            <properties>
                <source>flex.data.assemblers.SQLAssembler</source>
                <scope>application</scope>
                <metadata>
                    <identity property="ID" />
                </metadata>
                <server>
                    <database>
                        <datasource>java:comp/env/jdbc/SP</datasource>
                    </database>
                    <actionscript-class>com.somecompany.classes.SomeCoolClass</actionscript-class>
                    <create-item>
                        <procedure name="SomeItems_Insert">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Division_ID#" />
                            <procedure-param property-value="#Salesrep_ID#" />
                            <procedure-param property-value="#Area_Code#" />
                            <procedure-param property-value="#Item_ID#" />
                        </procedure>
                        <id-query>SELECT IDENT_CURRENT('Work_Area_Item')</id-query>
                    </create-item>
                    <fill>
                        <name>all</name>
                        <procedure name="SomeItems_Get">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Last_Sync_Time#" />
                        </procedure>
                    </fill>
                    <update-item>
                        <procedure name="SomeItems_Update">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Division_ID#" />
                            <procedure-param property-value="#Salesrep_ID#" />
                            <procedure-param property-value="#Area_Code#" />
                            <procedure-param property-value="#Item_ID#" />
                       </procedure>
                    </update-item>
                    <delete-item>
                        <procedure name="SomeItems_Delete">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Item_ID#" />
                        </procedure>
                    </delete-item>
                </server>
            </properties>
        </destination>
    </service>
    By default, ADEP returns results from SomeProduct.SomeItems destination to Flex side as ArrayCollection of SomeCoolClass instances but I need the data to be returned in simple AS3 Arrays. Recently, I found that there is small optional serialization configuration in channel-definition that should resolve my problem. So I updated my channel-definition in services-config.xml to this:
    <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel">
         <endpoint url="rtmp://{server.name}:1000" class="flex.messaging.endpoints.RTMPEndpoint"/>
         <properties>
              <serialization>
                   <legacy-collection>true</legacy-collection>
              </serialization>
              <idle-timeout-minutes>20</idle-timeout-minutes>
              <block-rtmpt-polling-clients>true</block-rtmpt-polling-clients>
              <rtmpt-poll-wait-millis-on-client>0</rtmpt-poll-wait-millis-on-client>
         </properties>
    </channel-definition>
    However, result are still returned in ArrayCollections.
    Any ideas?
    Thanks in advance

    Thom Parker answered this here: http://forums.adobe.com/message/2614570#2614570
    Answer copied below:
    "The problem is that when the focus is on the text box
    it's in edit mode. It's only displaying the value interactively entered by
    the user, or as a consequence of the change event.  What you need to do is
    force the focus off of the text box in code.  You can do a little trick
    where you bounce it to a tiny transparent field, which then bounds the focus
    back so it doesn't look like the focus changed."
    What I ended up doing was calling up the dialog box, then using setfocus with no parameters to remove focus from the field, as follows:
    this.rawValue = this.dialogBoxFunction(this.rawValue); // passing current value so dialog box defaults to that value
    xfa.host.setFocus();
    Cheers,
    Marty.

  • How to get result from another JSP file?

    I have to write a jsp (my.jsp) to get information from another jsp file (other.jsp).
    The other.jsp return integer value (0 / 1) so that user can tell if certain service is available or not. And in my.jsp I need to collect such result and other information from a text file to make up of a XML string.
    How can I call other.jsp to get the result? Thanks a lot.

    Hi, I think I didn't describe the problem clearly
    enough. In fact, there is a JSP file, and if our
    database is currently connected, the JSP will return
    value 1, otherwise, it will return 0. My java program
    need to get that result, and then form an XML string,
    and send the string back to the client. I'm just
    wonder how can I write such a program to read result
    from JSP file. Thanks a lot.Why is this function implemented as a JSP file? It should be implemented as a bean. It would be simple to get the information you require from that bean.

  • Multiple results from AXL query in CUCM 6.1

    Hi,
    I have an application that uses an AXL query to retrieve IP/Extension information from a Call Manager. For versions 4.x and 5.x it works fine: I get results back for my query (note that I send up to 200 elements per query). On 6.x however, I only ever get one response, so although my query fires off 200 IP addresses (or extensions) I only get an answer back on the first one. I cannot see why this has changed. I have checked the DB schema.
    The query is as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:tns="http://schemas.cisco.com/ast/soap/"
    xmlns:types="http://schemas.cisco.com/ast/soap/encodedTypes"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
    <tns:AstHeader id="id1">
    <SessionId xsi:type="xsd:string">1234-abcd-1234-abcd</SessionId>
    </tns:AstHeader>
    </soap:Header>
    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:SelectCmDevice>
    <StateInfo xsi:type="xsd:string"/>
    <CmSelectionCriteria href="#id1"/>
    </tns:SelectCmDevice>
    <tns:CmSelectionCriteria id="id1" xsi:type="tns:CmSelectionCriteria">
    <MaxReturnedDevices xsi:type="xsd:unsignedInt">1000</MaxReturnedDevices>
    <Class xsi:type="xsd:string">Any</Class>
    <Model xsi:type="xsd:unsignedInt">255</Model>
    <Status xsi:type="xsd:string">Any</Status>
    <NodeName xsi:type="xsd:string"/>
    <SelectBy xsi:type="xsd:string">IpAddress</SelectBy>
    <SelectItems href="#id2"/>
    </tns:CmSelectionCriteria>
    <soapenc:Array id="id2" soapenc:arrayType="tns:SelectItem[]">
    <Item href="#id3"/>
    </soapenc:Array>
    <tns:SelectItem id="id3" xsi:type="tns:SelectItem">
    <Item xsi:type="xsd:string">192.168.1.100,192.168.1.101</Item>
    </tns:SelectItem>
    </soap:Body>
    </soap:Envelope>
    As you can see it sends multiple (in this case 2) IP addresses. There is a second query that sends extension numbers. On earlier Call Managers this works fine, but on 6.x, it never returns more than one result.
    Any assistance would be appreciated.

    Congratulations on finding yet another bug. I'd really wish Cisco would start unit testing their APIs. While they use it themselves, the amount of functionality used (and thus tested) still pales in comparison on all the untested elements.
    However, perhaps there's at least a workaround for you: why do you need to look up by ip address? The only scenario I can imagine right now would be looking up a device name based on a service request from a phone.. and you can just add something like
    ?device=#DEVICENAME# to the service url and the phone will tell you its device name when making the first request (you have to add the name as query string parameter or as a session variable for subsequent requests).

Maybe you are looking for

  • Can I use more than 1 apple ID on a device

    i need to get all my music from one apple I'd onto my new ipad2 that has another apple I'd

  • Cannot print -- random text & blank pages when printing -- HP Color Laserjet 3600N

    Apple Support Community, I'm having some trouble connecting my computer and printer via a network connection. The printer functions fine among other computers (Mac, PC) connected via a network connection, but one particular MacBook is giving me troub

  • External HD Not Working Yosemite

    After I updated my Macbook Air to Yosemite, my 2T Lacie Porche Design External HD kept ejecting after a minute or so after being plugged in. I tried all the troubleshooting there is to try in this site. I took my macbook to an Apple store with the HD

  • BPM Alert in SolMan

    Hello All, Just want to ask how to stop the BPM alert in SOlMan from sending to a specific email. Where can I check the configuration? What steps to do? Thanks and regards, Eco

  • Master data medium text

    Hi, Master data medium text and long text is not appearing eventhough i checked Medium and long texts in the master data /texts tab page.Plz let me know the solution. Thanks, Sr