extraction of lines

Hi guys

I was learning on the tables and came across a tutorial exercises on ni.com. I am equipped with a 2D array and must be able to retrieve any table of line or a given column of her. Now the simple would be to use array index, however, I tried to do the same thing using a while loop as shown in the attached vi, I want to get the 3rd rank, can someone tell me where I can go wrong...

cquark wrote:

I want to get the 3rd table line, could someone tell me where I can go wrong...

In your program, the loop For external will return a value of 79 which you compare with 2 (I hope you are trying to get the 3rd rank) at the next loop. This is the error. Why you don't want to use a table to index? OK based on your attached test method (change the while loop only). After the return.

Tags: NI Software

Similar Questions

  • Easy way to extract the line of two-dimensional array?

    Y at - it an easy way to extract a two table row Dimensions? I have two lists of table to a dimension that I consider a pine table, where each pin list is a table of numbers. I want to go through it and to extract a line at a time to send in a vi. Currently, I'm looking to do a bit of a long way, and I was wondering if there was an easier way. The long way:

    GetArrayBounds (Locals.ArrayOfPinsToTestAtOnce, Locals.BogusString, Locals.ArrayBounds), / / enter the quantity of lines and columns Locals.ArrayBounds
    Locals.ElementsPerList = Val (Mid (Locals.ArrayBounds, 1, 1)), //Get number of bowling by list
    Locals.NumberOfLists = Val (Mid (Locals.ArrayBounds, 4, 1)), //Extract number lists
    SetArrayBounds (Locals.OneRow, "[0]", "[" + Str (Locals.ElementsPerList) + "']" ") //Set table defines for a line chart
    < locals.numberofgroups;="" i++="" )="" would="" be="" done="" in="" teststand="" step,="" just="" for="" easy="">
    {
    < locals.elementsperlist;="" j++)="" also="" would="" be="" done="" in="" teststand="">
    Locals.OneRow [j] = ArrayOfPinsToTestAtOnce [j] [i]
    PERFORM STEP HERE (Locals.OneRow)
    }

    Thanks for the tips!

    In all honesty, I just want to do in LabVIEW.  You can try to add to the list in this idea.

  • Extract the lines of VO

    Hi all

    I'm dealing with a question about extraction of VO lines. My situation is as below:

    I run VO1 and serched about 20 records, but a single page display 10 records. When I updated the first 10 records, then I update next 10 records. Then I click the button Save.

    But I found only 10 next set records up-to-date.

    I used the row [] rowall = vo.getAllRowsInRange () to fecth all lines. But I found it just go get next 10 records. So, how can I get all the ranks?

    Thank you and best regards

    Allen

    Hi Amey,

    Thanks for your reply. I use pagination to go to the next page. And I used vo.setRangeSize(-1) to get all the lines. and it works.

    Kind regards

    Allen

  • extract table lines


    Based on the previous solution, I have another application for you to try:

    "You can do a right click on your tunnnel of out of the loop For and select the Tunnel Mode ' conditional (make sure indexing is also checked). This will now only add rows to the table if the Boolean is true. In this case, if the first item in the line is equal to "1".

  • Sale report std Oracle to extract all lines out of stock orders

    Hello Experts,

    Y at - it no Oracle standard reports that can provide us with the details of all out of stock lines in all levels of sales? Pls advise.

    Kind regards

    Viviane

    There is a report entitled "Report to detail in suffering" under the execution of shipping.

  • Extract single line transformed from two tables

    I have two tables T1 and T2 with the same set of columns. The columns are C1, C2, C3, COND1. I need to issue a query that returns a line transformed in order to respect the following rules:

    1. the returned line may contain values from both tables based on the values of column in table T1.

    2 return the column C1 in table T1; If it is NULL, then return to any value is present in the column C1 of T2.

    3. article 2 above apply to all columns like C1, C2 etc.

    I published the following query. The problem is that if a subquery does not reach the entire query fails. Someone help me please. Probably there is another simple method.

    SELECT NVL (T1.c1, T2.c1) c1, c2 (T1.c2, T2.c2) NVL NVL (T1.c3, T2.c3) c3

    FROM (SELECT c1, c2, c3

    FROM T1

    WHERE cond1 = 'T10') T1

    (SELECT c1, c2, c3

    THE T2

    WHERE cond1 = "T200") T2;

    Hello

    user4274403 wrote:

    I have two tables T1 and T2 with the same set of columns. The columns are C1, C2, C3, COND1. I need to issue a query that returns a line transformed in order to respect the following rules:

    1. the returned line may contain values from both tables based on the values of column in table T1.

    2 return the column C1 in table T1; If it is NULL, then return to any value is present in the column C1 of T2.

    3. article 2 above apply to all columns like C1, C2 etc.

    I published the following query. The problem is that if a subquery does not reach the entire query fails. Someone help me please. Probably there is another simple method.

    SELECT NVL (T1.c1, T2.c1) c1, c2 (T1.c2, T2.c2) NVL NVL (T1.c3, T2.c3) c3

    FROM (SELECT c1, c2, c3

    FROM T1

    WHERE cond1 = 'T10') T1

    (SELECT c1, c2, c3

    THE T2

    WHERE cond1 = "T200") T2;

    Are you saying that if there is no row in t1 that satisfy the condition cond1 = "T10", then you want to keep seeing the lines (and values) of the t2?

    And even, if there is no row in t2 that satisfy the cond1 = "T200" condition, then you want to keep seeing the lines (and values) from t1?

    If so, this looks like a job for a full outer join.

    You can change the join in a full outer join as follows:

    SELECT NVL (T1.c1, T2.c1) AS c1

    , NVL (T1.c2, T2.c2) C2

    NVL (T1.c3, T2.c3) AS c3

    FROM T1

    FULL OUTER JOIN T2 ON t1.cond1 = 'T10 '.

    AND t2.cond1 = 'T200.

    WHERE t1.cond1 = 'T10 '.

    OR t2.cond1 = "T200"

    ;

    If you would care to post CREATE TABLE and INSERT instructions for some examples of data, then I could test this.

    What happens if no table has all the lines that have good values in cond1?

  • Extract multiple lines using the technique of the cross join

    Hello.

    Can someone suggest a method to return 3 lines of a query when otherwise would return only one line?

    I am trying to reach the analog SQL logic to this topic-
    SELECT x.foo, p.id, p.name FROM people p CROSS JOIN (SELECT 1 AS foo UNION ALL SELECT 2 UNION ALL SELECT 3) x;
    Reason: I want a result three rows (n) force and use GROUP BY with case statements to create 3 levels summary.

    Here is a simple SQL logical expression that works for my setup - OBI
    SELECT
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number saw_0,
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".SR_Operating_Unit_Name saw_1
    FROM
         "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service"     
    WHERE 
         ("- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number = '338246')
    But I think that I can't do--
    SELECT
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number saw_0,
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".SR_Operating_Unit_Name saw_1
    FROM
         "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service"
         CROSS JOIN (SELECT 1 AS foo UNION ALL SELECT 2 UNION ALL SELECT 3)
    WHERE 
         ("- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number = '338246')
    But what peut do?

    Thank you.

    -cs

    Hi CSeelig,

    The BI server uses the ANSI SQL standard. Then all the SQL that follows this specification in OBIEE will work.

    I did an example with intensification:
    http://gerardnico.com/wiki/dat/OBIEE/logical_sql/obiee_sql_densification

    You will see a cross join to make a densification.

    See you soon
    Nico

  • extract all lines if condition is met

    Hi all, consider the following data.
    WITH table1 AS 
    (
      SELECT 1 amt, 'dummy' txt, 'R' txt2 , '1X' pid FROM dual UNION ALL
      SELECT 123 amt, 'CATS' txt, 'P' txt2, '1X' pid FROM dual UNION all
      SELECT 145 amt, 'CAR' txt, 'PR' txt2, '1X' pid FROM dual UNION all
      SELECT 165 amt, 'NAME' txt, 'P' txt2, '1X' pid FROM dual UNION ALL
      SELECT 166 amt, 'NAME' txt, 'PK' txt2, '1X' pid FROM dual UNION all
    
    
      SELECT 100 amt, 'dummy' txt, 'R' txt2, '2X' pid FROM dual UNION ALL
      SELECT 13 amt, 'CATS2' txt, 'P' txt2, '2X' pid FROM dual UNION all
      SELECT 15 amt, 'CAR2' txt, 'PR' txt2, '2X' pid FROM dual UNION all
      SELECT 15 amt, 'NAME2' txt, 'P' txt2, '2X' pid FROM dual 
    
    )
    I want to display the following result
    AMT  TXT    TXT2  PID
    ========================
    1    DUMMY  R     1X
    123  CATS   NO    1X
    145  CAR    NO    1X
    165  NAME   NO    1X
    166  NAME   PK    1X
    
    
    100 DUMMY   R     2X
    13  CATS2   P     2X
    15  CAR2    PR    2X
    15  NAME2   P     2X
    the logic behind this output is as follows:
    When I find a line whose amount is 1 or - 1 and txt = dummy, I want to take the pid of this line value and find all lines with this pid where txt2 (p, PR) and set the txt2.
    If txt2 is not in P or PR, and then set the column to the current value

    for example. the first line of data above has amt = 1 and txt = model. I'll take the pid of this line, which is 1 X and find all the other lines with this value of pid and txt2 in P, PR
    in this case I found the line with amt = 123, 145, 165. I display the rows in output but txt2 change no.

    If you notice, line with amt = 166 wasn't the change as txt2 = PK. in the second series of data, I view the data, as is since I couldn't find a line with amt in(1,-1) and txt = model


    can someone help me write a query to display the above output?

    Hello

    Here's one way: use the function SUMMARY, with a CASE expression:

    SELECT       amt
    ,       txt
    ,       CASE
              WHEN  txt2  IN ('P', 'PR')
              AND   0 < COUNT ( CASE
                                       WHEN  amt     IN (1, -1)
                              AND   txt     = 'dummy'
                              THEN  1
                                   END
                                 ) OVER (PARTITION BY pid)
              THEN  'NO'
              ELSE  txt2
           END     AS txt2
    ,       pid
    FROM       table1
    ;
    
  • The query results: extract all lines?

    I was looking for a feature that will allow me to choose to return "all records" in the query results window. The current behavior is fetching 50 files at a time (for example fetch 50 records when you scroll the results = s-l-o-w). What I would do, that is 'Recover all lines' and then use for the scroll bar to scroll "smoothly" to the last record. For example, the 8.0.6 Query Builder version has this feature and SQL Developer 3.0, if I right click on the results. I choose 'Count lines... ". ", looks like it would be a perfect place to put an option"retrieve all rows.

    If your application is to be able to quickly reach the last record in a query you can press Ctrl + Page Down (with emphasis in the grid of results) and you will automatically position your view to the last record in the query automatically go get all the results in the process.

    You have no need to do anything with the mouse scroll is actually the fastest way to reach the desired line.

  • Extraction of lines deleted after opening, but before than fetch.

    The following seems to work, but I would like to know,
    If this is documented in order to be valid on 9iR2 and later versions.

    This should work if I have read the guide of the concepts (Chapter 1):
    «Read-consistent, as supported by Oracle...» Ensures that all data seen by a statement is consistent with what is
    a single point in time and don't change during the execution of the statement"

    I use using the default isolation level (read committed).
    but I don't think that matters.
      function getRows return sys_refcursor is
        result   sys_refcursor;
      begin
        open result for select * from myTable where xxx;  -- xxx just means the two where
        delete myTable                        where xxx;  --     clauses are the same
               
        return result;
      end;
    The function is supposed to return a few lines to the customer to deal with.
    If successful, the validation client, if not lower customer prices

    To be precise:
    I read correcly documentation?

    Yes.

  • SQL statement by using the min aggregate function result extract a line - how?

    Need help, try to do something seemingly simple. I'll give a simple example to illustrate the problem.

    I'll use a simple table of addresses with 4 fields.

    Create the table:
      CREATE TABLE "ADDRESSES" 
       (     "OWNER_NAME" VARCHAR2(20 BYTE), 
         "STREET_NAME" VARCHAR2(20 BYTE), 
         "STREET_NUMBER" NUMBER
       ) ;
    complete with 6 rows
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('FRED','MAIN',1);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JOAN','MAIN',2);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JEAN','MAIN',3);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JACK','ELM',1);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JANE','ELM',2);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JEFF','ELM',3);
    We now have this:
    Select * from addresses
    OWNER_NAME           STREET_NAME          STREET_NUMBER          
    -------------------- -------------------- ---------------------- 
    FRED                 MAIN                 1                      
    JOAN                 MAIN                 2                      
    JEAN                 MAIN                 3                      
    JACK                 ELM                  1                      
    JANE                 ELM                  2                      
    JEFF                 ELM                  3                      
    
    6 rows selected
    Now, I want to group by street name and obtain a number of houses. At the same time, I would like to know the number of the first and the last House
        select
        street_name,
        count(*) "NBR HOUSES",
        min(street_number) "First Number",
        max(street_number) "Last Number"
         from addresses
        group by street_name
    
    produces
    
    STREET_NAME          NBR HOUSES             First Number           Last Number            
    -------------------- ---------------------- ---------------------- ---------------------- 
    ELM                  3                      1                      3                      
    MAIN                 3                      1                      3                      
    
    2 rows selected
    Excellent. Now for the problem. I would also like to list on each line, the owner who lives at number House first and/or the last. It should be noted, assume that the name of the street and the number is unique

    It seems I have everything that I need. Don't know how to get home.

    I tried:
    select
        street_name,
        count(*) "NBR HOUSES",
        min(street_number) "First Number",
        max(street_number) "Last Number",
        (Select b.owner_name from addresses b where b.street_number = min(street_number) and b.owner_name = owner_name) "First Owner"
         from addresses
        group by street_name
    But getting a syntax error sql group function unauthorized when I add the subselect statement.

    any ideas?

    Thanks for any help.

    Published by: user6876601 on November 19, 2009 19:08

    Published by: user6876601 on November 19, 2009 19:30

    Hello

    Welcome to the forum!

    Get the minimum and maximum number for each street is a pretty simple concept; simpler to describe and simple to code.
    Now you want to the owner_name associate the maximum and minimum, which is a concept more complex; a little more difficult to describe and, unfortunately, much less simple to code and much, much more difficult to explain:

    select
        street_name,
        count (*)                "NBR HOUSES",
        min (street_number)      "First Number",
        min (owner_name) KEEP (DENSE_RANK FIRST ORDER BY street_number)
                        "First Owner",
        max (street_number)      "Last Number",
        min (owner_name) KEEP (DENSE_RANK LAST ORDER BY street_number)
                        "Last Owner"
         from addresses
        group by street_name
    ;
    

    You will notice that I used min for "Original owner" and "last owner". Why is this?
    The key word in these functions is the FIRST or the LAST word that comes after DENSE_RANK and before ORDER BY. The function at the beginning is simply a break.

    In other words, MIN in this context refers only to what needs to happen when there is a link to the first or last in the group. Even if such a thing is impossibe in your data, generic functions must have a mechanism to return a single owner_name when two or more rows have an equal right to having the highest street_number. For example, if we change the address of Joan in 1 hand, then MIN (street_number) is always 1, of course, but who is the person associated with the minimum street_number: Fred or Joan? Both have an equal claim that he owns with the smallest address on Main Street, but aggregate functions must return a single value, so we must have a mechanism to indicate to the system, whether to return 'JOAN' or 'FRED '. In this example, I arbitrarily in the network said een of tie, the lowest name, in alphabetical order, must be returned. In this case, 'FRED' would return, "FRED" prior to "JOAN".

    Thank you for including CREATE TABLE and INSERT!

  • How to extract the lines at a time?

    I know that I can use rownum back n rows at a time, but the rownum function will apply after that all rows are returned by the query, which is bad for performance, because my table contains many rows. What I need, it's really get n lines both of the DB.

    Concerning

    I'm not sure what you mean by "the rownum function apply after that all rows are returned by the query", but this seems to be a wrong statement. If you have a limit of ROWNUM in a query, Oracle knows he has only fetch the first rows of M.

    If looking for an ability to paginate the results of a query, there is a thread of AskTom on paging in SQL.

    This would be appropriate, however, if you expect that users will never want the first pages of results (i.e. Google users do not have to browse all the pages of results for a generic search term, they're going to look at page 1, may be page 2 and page 3 and then stops). If the application must process all the rows that the query returns, you would need another building, and we would need some additional requirements. Your client application can probably fetch N rows at a time. If the customer is PL/SQL, a COLLECTION in BULK with a LIMIT clause may also be useful.

    Justin

  • Divide the extracted almost lines also and assign a group

    Hi all

    I have the table:

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0-
    SQL> select * from upd;
    
             A B
    ---------- ----------
             1 xxxx
             2 xxxx
             3 ddd
             4 d
             5 t
    Suppose I have only 5 groups and each group can have only 2 rows, example:

    assign the 2 rows to G1, G2 and G3 2 ranks, still something like
          A B            Group
    ---------- ---------- 
             1 xxxx       G1
             2 xxxx       G1
             3 ddd        G2
             4 d            G2
             5 t            G3
    Help, please

    Published by: user8650395 on November 8, 2009 01:13

    Hello

    Analytical NTILE function could do that:

    SQL> with upd as (  -- generating sample data:
      2  select 1 a, 'xxxx' b from dual union all
      3  select 2, 'xxxx' from dual union all
      4  select 3, 'ddd' from dual union all
      5  select 4, 'd' from dual union all
      6  select 5, 't' from dual
      7  )
      8  --
      9  -- actual query starts here:
     10  --
     11  select a
     12  ,      b
     13  ,      'G'||ntile(3) over (order by a) grp
     14  ,      ntile(3) over (order by a) ntile_result
     15  from   upd;
    
             A B    GRP                                       NTILE_RESULT
    ---------- ---- ----------------------------------------- ------------
             1 xxxx G1                                                   1
             2 xxxx G1                                                   1
             3 ddd  G2                                                   2
             4 d    G2                                                   2
             5 t    G3                                                   3
    

    See: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions101.htm#SQLRF00680

  • &lt; netui-data: pager &gt; action to extract lines dynamically

    Hello

    How can I configure a pager of DataGrid to dynamically extract lines when a user through the paging swap pages?
    I know that I can read all my lines to a collection / array before the rendering of the datagrid control and set the pager to iterate on it like this:

    [Controller]

    Private list < Ride > wrinkles;

    public list < Ride > getRides() {}
    return of the rides;
    }

    [Action]
    wrinkles = rideDBControl.getAllRides (); huge amount of data
    ...
    back to the front;
    }

    [JSP]

    "< div style =" "border-width: 2px;" > < netui-data: dataGrid name = "currentRidesGrid" dataSource = "pageFlow.rides" >
    < netui-data: configurePager pagerFormat = "prevNext" pageSize = "${pageSize}" / >
    < netui-data: header >
    < netui-data: headerCell headerText = "Name" / >
    < netui-data: headerCell headerText = "Description" / >
    < / netui-data: header >
    < netui-data lines: >
    < netui-data: spanCell value = "${container.item.name}" style = "background-color: #f0f0f0; do-size: 14pt; ">
    < / netui-data: spanCell >
    < netui-data: spanCell value = "${container.item.description}" >
    < / netui-data: spanCell >
    < / netui-data lines: >
    < / netui-data: dataGrid > < / div >

    But how can I make the pager call a method to update the content of the collection "wrinkles" according to the current selected page and the size of the page? And how do I get the current page and the size of the page inside this method?
    I want to be paginated queries that may return a huge amount of data (1 m + lines), so extract all lines at once is impossible. What I want to do, is spreading the current page and the page size of pager to a method that will update the current collection according to a query such as:

    Select X, Y, Z
    Table
    Where the...
    And ROWNUM BETWEEN page * pageSize AND (page + 1) * pageSize

    Can someone help a noob?

    For more information, I found the answer by myself.

    To retrieve the rows dynamically, you must change the tag , and include the attributes a pageAction and partialDataSet, for example:

    Within the action of pagination, you can get the current size of the line and page of a PagerModel object. You can then update the data source (don't forget to call the setDataSetSize providing the length of the entire data so that the pager shows the right amount of pages), for example:

    @Jpf.Action (forward = {@Jpf.Forward (name = "success", access = Jpf.NavigateTo.currentPage)})
    {public pagination() before
    DataGridStateFactory dataGridStateFactory = DataGridStateFactory
    .getInstance (getRequest ());
    Gets the pagerModel for the grid object
    PagerModel pagerModel = dataGridStateFactory.getDataGridState)
    "currentRidesGrid") .getPagerModel ();
    => Code to get the size of any data source<>
    pagerModel.setDataSetSize (dataSourceSize);
              
    Get the first line and the model page size
    int firstRow = pagerModel.getRow ();
    int pageSize = pagerModel.getPageSize ();
              
    => Code to extract the rows to display<>
    wrinkles = pageRides;
              
    Forward, forward = new Forward ("success");
    back to the front;
    }

    I hope this helps.

    See you soon

  • Automatic line extraction

    Hello

    I have a table called name with only two field - ID (number) and the name (Varchar2)

    I have create a very simple form with only two filed text -: P1_ID AND: P1_NAME
    The two fields have Source - database column and still replaingn the existing value in session state.

    After this, I create a page rendering process.
    DML-> Fetch of automatic line
    On the Source tab, I have
    Table: name
    Element that contains the primary key value: P1_ID
    primary key column: ID

    When I click on link for report and comes to page 1, it throws an error
    ORA-06550: line 1, column 17: PL/SQL: ORA-00936: lack of expression ORA-06550: line 1, column 9: PL/SQL: statement ignored


    The treated DML only works with forms created by the wizard?

    If not, then surely miss me something...


    Thanks in advance for any help that will help me understand built in process of DML.


    Kind regards
    Shijesh

    On the Source tab, I have
    Table: name

    It's fake, there is no field called "Table: You are so not to show us what you have entered.

    Make sure that all names are written in capital letters on this page and in the value of the Source (column name) for each form element associated with the extraction of line process.

    Scott

Maybe you are looking for