moving table to a spreadsheet of loop string to accelerate the program

I'm working on a program that should save about 1200 number of data in a spreadsheet file several times per second (the longer the better). Right now, it reads all the data peak, puts all the data in a table 1 d of dbl, converts the array to a string of worksheet and adds the data to the output file, all inside the loop. The problem is that the loop takes a long time to run, then he tops out at about 480 Hz time through the loop. I think that the table to the string of worksheet function is what is bogged down. I just need to record a few seconds of data, so I thought that I could somehow put the data in memory (perhaps an array of arrays?) while the loop tracks, then convert it to the string of spreadsheet and save it outside of the loop. I'm pretty new to labview, and I'm not familiar with how to do it. Any suggestions?

There are enough little things you can do to optimize this operation:

  1. Learn more about the producer/consumer architectures.  This kind of thing works best with two or more loops.  For example, we take the data and independently, it is shaped and writes data to the disk.  Alternatively, you could have a given to a format the data and you write the data to disk.
  2. Use queues to pass data between the loops.
  3. For best performance in writing on Windows platforms, write songs about 65 000 characters.  This means that you will need to put your data in the buffer and write it in pieces as soon as they are available.  You can use a shift register on the loop to write to the buffer and write only when size is greater than 65 000 characters.

There is a lot to digest in a short period of time.  Give a shot and post your code with other issues we can help you more.

Tags: NI Software

Similar Questions

  • concatenate the data in 2 tables in a third table as well as in CONCATENATE strings

    Hello. as the title says, I wish to only concatenate the data in 2 tables in a similar third table that concatenate strings don't. All tables should be 1 d. For example, suppose that there is 1 table with the following: 1. 2; 3; 4 and table 2 with:; b; c; d. I would like a table 3 either 1 a, 2 b, 3 c, 4 d. Now this could be done easily with above mentioned concatenate strings, then table construction. but table 1 and 2 have something like 150 items. Rather painful. Any ideas?

    Hold arrays of two strings in a loop for example, concatentate the strings inside the loop and run the result réécrirait array3.

    Autoindexing manages table manipulations.

    MIke...

  • Creating tables in a nested for loop

    Hi all.

    I was stuck in this problem for quite a while now and I still don't know how to continue. Some outside the entrance would be greatly appreciated!

    I'm doing the following:

    -Take an array of numbers, to check if they are within a certain range (e.g. between 2 and 4)

    -Build two new arrays: one with all the numbers that are inside the beach and the other with the rest.

    An additional condition is that the amount and value of the range conditions will change (for example, it could be between 2 and 4 only / 2, 4 AND 6 and 7 according to the entry)

    To treat this, I created two nested for loops - one that goes on a table that contains conditions of the beach and inside that actually go and check if the values are in the range. I think I did that part successfully, but the next part is confusing to me - how to actually create the tables separated within two loops for?

    My apologies if I did not explain it well. Another method to support this problem is I want to translate following LabVIEW:

    Ranges of table / / [1 5 7 10] exodus-> This means we want to divide numbers based on those who are in (1,2) and (4.5) against those who are not

    Table of values / / [2 3 6 11 3]

    EndOperationDelegate table / / array of values within the range
    Table outValues / / Array of values out of range

    for m = 1:size (ranges)

    for n = 1:size (values)
    If (THE NUMBER IS on the INSIDE of EACH RANGE)
    EndOperationDelegate = [EndOperationDelegate NEWNUMBER]
    on the other
    outValues = [outValues NEWNUMBER]
    end

    end
    end

    Sounds easy enough, but it gets so chaotic with Labview that I don't know what to do. I have attached a reference image - insertion in the array function is not in fact add to the table, it creates a new table. How can I save that for when the nested for the ends of the loop?

    I have seen a few examples with shift registers which lie in a loop and I couldn't successfully that transfers in my block diagram.

    Any help/direction would be greatly appreciated.

    Hello!

    See the following example to understand how you can create a table in the loop For

    In your case, you also can uce conditional terminal to create a table only when then located nearby. It makes the code much cleaner that the structures of the case

    Hope this helps, if not, let me know if I can help you!

    Marcin

  • Index rebuild after moving table to a different tablespace?

    Index rebuild after moving table to a different tablespace?

    Oracle-Meng wrote:

    Index rebuild after moving table to a different tablespace?

    Only if you want to reuse.

    See DBA guide

    http://docs.Oracle.com/CD/B28359_01/server.111/b28310/tables006.htm#i1106606

    Pass an array to a new Segment or a Tablespace

    Move a table changes the ROWID of the rows in the table. This causes the indexes on the table to be marked UNUSABLE , and DML, access the table using these clues you will receive an ORA-01502 error. The indexes on the table must be deleted or rebuilt. Similarly, all the statistics in the table become invalid and new statistics should be collected after the removal of the table.

  • ORA-01775: looping string of synonyms

    There are several Oracle errors in the alert.log file. The errors are as follows:

    ORA-12012: error on auto work 119785
    ORA-01775: looping string of synonyms

    There are synonymous 17946 sysnonyms PUBLIC and 3 application.

    The question looping synonymous in database xxx. I have to identify the synonym (s) that has been defined that referred to itself.

    How to identify the synonym (s) who has been defined that is mentioned of 17946?

    I would be grateful for any suggestions to correct the above errors.

    Thank you!

    Hello

    First of all, you can identify what makes this work by running the following query:

    select job, schema_user, what
    from dba_jobs
    where job = 119785;
    

    Then, since the PL/SQL or the executed program, you can get the name of the synonym and try to get
    its definition:

    Select synonym_name, table_owner, table_name, owner
    of dba_synonyms
    where synonym_name = {color: red} synonym_name {color};

    The "Table_name" gives the object referenced by the synonym you then, you can check if
    This is another synonym.

    Before you delete any synonym, it is best to check if this synonym is used by another object. A procedure,
    a package can become invalid if they referred to a synonym has dropped.

    Hope this helps.
    Best regards
    Jean Valentine

  • Bearings of navigation moving tables/images - why?

    Hi, I use CS3 FW and DW CS3 and I'm on an iMac 24 ". These sites are driving me crazy with the IE 7 browser. In BOTH cases, the effect of substitution of navigation causes somehow table or the image to move. Note: use tables to create my websites.

    This ONLY happens in IE - at least systematically. I rechecked my Fireworks files to set the location of the images as identical in frames 1 and 2. And I checked my margins on my DWT models to ensure that no space got accidentally inserted.

    Also in the site Bright belt music, my bearings don't even highlighted, on ANY browser.

    Are these DW CS3 bugs maybe?

    Here are my sites; I hope it's okay list both because they both have the same question. I checked some of these pages for validation, but I'm not all by with that yet.

    Thanks a lot for any help on these. This issue has been a thorn in my side for months.

    www.brightbeltmusic.com

    www.frankbright.com/index3.htm

    I'm on Windows7 and IE 8.

    On the reversal, the table moves down a few pixels. It's the strange Veery why happen in some browsers and not others.

    Welcome to hell of browser!

    Try running IE8 in IE7 Compatibility Mode.

    http://www.Microsoft.com/UK/Windows/Internet-Explorer/features/enhanced-navigation.aspx

    If it looks OK in IE7 mode, then you can force your page to be seen correctly by adding a line of code in your web pages.  This link shows how.

    http://davidwalsh.name/IE8-emulate-IE7

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB
    www.Alt-Web.blogspot.com

  • Get the bind variables name string SQL or the cursor

    Hello

    Is there way to get of the bind variables name string SQL or the cursor?

    Example of
    DECLARE
      l_sql VARCHAR2(2000);
      desctab DBMS_SQL.DESC_TAB;
      curid   PLS_INTEGER;
    BEGIN
    
      l_sql := 'SELECT * FROM emp WHERE mgr = :X and deptno = :Y';
    
      curid := dbms_sql.open_cursor;
      dbms_sql.parse(curid, l_sql, dbms_sql.NATIVE);
      ....
    END;
    What I mean with the SQL string:
    I love to get using some functions from above code variable l_sql all the bind variable.
    In this case the function should return array where is for example: X and: Y

    Back to bind the cursor variable names, I mean same but rather string I pass number of cursor.

    Y at - it sucks ready function or some may share a code customized for this purpose?

    Thanks

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0Regards,

    Published by: jarola December 19, 2011 02:44

    I found there are wwv_flow_utilities.get_binds of the function not documented in APEX packages that do what I want.
    Usage example
    set serveroutput on
    DECLARE
      binds DBMS_SQL.varchar2_table;
    BEGIN
      binds := wwv_flow_utilities.get_binds('select :P1_TEST from dual');
      FOR i IN 1 .. binds.count
      LOOP
        dbms_output.put_line(binds(i));
      END LOOP;
    END;
    /
    
    anonymous block completed
    :P1_TEST
    But I would not use these functions without papers as those who can change or there is no future versions APEX.
    Is there a documented function or the custom function that do the same thing as wwv_flow_utilities.get_binds?

    Some old basic example code of my friends. Also the media getting the bind variable of PL/SQL code blocks anon.

    SQL> create or replace function GetBindVariables( statement varchar2 ) return TStrings is
      2          --// bind variables names are terminated by one the following special chars
      3          SPECIAL_CHAR    constant TStrings := TStrings(' ',')','+','-','>','<','*',',','=',';',CHR(10),CHR(13));
      4
      5          --// max size of a bind var name
      6          MAX_VARSIZE     constant integer := 100;
      7
      8          pos     integer;
      9          pos1    integer;
     10          occur   integer;
     11          varName varchar2(100);
     12          varList TStrings;
     13  begin
     14          varList := new TStrings();
     15
     16          --// looking for the 1st occurance of a bind variable
     17          occur := 1;
     18
     19          loop
     20                  pos := InStr( statement, ':', 1, occur );
     21                  exit when pos = 0;
     22
     23                  varName := SubStr( statement, pos, 100 );
     24
     25                  --// find the terminating char trailing the
     26                  --// bind variable name
     27                  pos1 := Length( varName );
     28                  for i in 1..SPECIAL_CHAR.Count
     29                  loop
     30                          pos := InStr( varName, SPECIAL_CHAR(i) ) - 1;
     31                          if (pos > 0) and (pos < pos1) then
     32                                  pos1 := pos;
     33                          end if;
     34                  end loop;
     35
     36                  --// extract the actual bind var name (without
     37                  --// colon char prefix)
     38                  varName := SubStr( varName, 2, pos1-1 );
     39
     40                  --// maintain a unique list of var names
     41                  if not varName member of varList then
     42                          varList.Extend(1);
     43                          varList( varList.Count ) := varName;
     44                  end if;
     45
     46                  --// look for the next occurance
     47                  occur := occur + 1;
     48          end loop;
     49
     50          return( varList );
     51  end;
     52  /
    
    Function created.
    
    SQL>
    SQL> select
      2          column_value as BIND_VAR
      3  from TABLE(
      4          GetBindVariables('select * from foo where col=:BIND1 and day = to_date(:B2,''yyyy/mm/dd'')')
      5  );
    
    BIND_VAR
    ------------------------------
    BIND1
    B2
    
    SQL> 
    

    PS. just realize this code is case-sensitive, while variable bind is not. Should throw a upper() or lower() by adding the name of the var to the list - never really a problem for me because I'm pretty tense when it use cases correctly in the code. ;-)

    Published by: Billy Verreynne, December 19, 2011 06:19

  • Table do not reset in the program between tracks

    Hello everyone, I am looking to write a program to assign physical channels pragmatically to a task for the acquisition of data that will be used to record data. In the sake of understanding, the program will be used to save the data of thermocouple and I would like the versatility with my VI. The goal is to get it rid DAQ assistants we currently use so there is no need to rewrite the channels in DAQ assistant, whenever they need to be changed (which is quite often).

    On the problem. The question I have, is that the table used to store the list of physical channels is no discount between the delivery of the program. This translates into an error of conflict channel names (just using the name of the physical channel as the channel name). My current guess as a way to fix this is to initialize the table at the beginning of the program. Problem with that is I need the physical channel DAQmx type table and I was not able to initialize an array like this. I have attached my VI below. Any help would be greatly appreciated and thanks in advance for any help you can give.

    Your shift on the loop register is unitilized which means that it will retain its value. You must explicitly initialize the shift register. You'd also better off auto build the table instead of using the Insert in the table.

  • Analyzes the string and extract the string delimiter

    Hello

    Basic questions.  Is this possible with the scan of regular expression of the string to extract the string that are in the specified delimiters.  Here is an example:

    Name of the \\Name of the folder 1\Name to the folder 2\Name to the folder 3\File

    Chain analysis can produce the following by specifying the regular expression on the right:

    1 folder name

    Name of the folder 2

    Name of the folder 3

    File name

    I tried \\\%s\\%s\\%s\\%s but the %s stops on the first white space.

    Thank you

    Michel

    RavensFan suggested the service appropriate for your condition, but you can also use an alternative, which is "spreadsheet of array of strings.

  • file dialog (read/write spreadsheet) causes the program to freeze hang

    LabVIEW 8.6, in the first loop, I use the spreadsheet write vi to register data acquired from an SCXI module / PXI system to a specific folder on the desktop. I have a second loop (with the event structure) which uses the spreadsheet read vi to read a data file specified user whose trace it then. The problem I encounter is when the file vi prompt dialog box runs into the spreadsheet read vi, the first loop (it says data continuously) crashes until a file is chosen and opened. Any suggestions on how to get these two functions to work together?

    Then use a control path of the file on your front and then the user can still select the file by clicking the Browse button. The other loop will run if the user clicks the Browse button to select a file. In your code so the event is triggered by an empty path, do nothing.

  • Help with the efficiency of the program, stop a loop for?

    Hi all

    I need some advice programming General to help my VI to operate more effectively.  I have a table in which the program runs each point and 2d compares the value for the surrounding points.  The user can select the range of cells to inspect range, so if the user selects 1, then, it will compare the point (0,0) to all cells in a single cell.  If the user selects 2, then all the cells in a range of cells 2 and so on.  If the point (0,0) is superior to everything around him, then he writes this point in a table.

    I made more notes in the VI to explain what is happening, but I think that the program would be more effective if I could stop a for loop to run as soon as it detects a false condition, i.e. the point (0,0) is not more than one of the surrounding points.  As it is right now, it compares at all points around him, writing TRUE/FALSE for a table, then checks if all conditions are TRUE.  That takes a lot of time if the user selects a value of 8, for example.  It would reduce a lot of processing time if he just threw to the next point as soon as it finds a FALSE condition.

    Any other advice would be appreciated as well.  Try to be a more effective programmer!

    Thank you!
    Alex

    I do not attach the data file, because it is too big.

    In versions before the invention of the loop For with conditional stay terminal, you can do it, but you have over what a while loop to stop when your condition is True, OR when the terminal i is equal to the size of the incoming array - 1.

  • Use of LabView delay in a while loop instead of use the inherent instrument of time loop.

    I have a lmg500 sez I use. It has the possibility of continuous measurement of data, with a cycle of user control loop (always using a while loop but the delay comes from the instrument). The problem is that the time of the loop is not constant. Can I use a very short time (100ms) as the cycle of the instrument of the time, but use a longer period in time loop collect data?

    I know that many instrument offers the same capabilities, so the issue is relevant to each of them.

    Thanks for any help

    You're not going to be accurate with Windows. The time between samples should be that you have programmed the instrument (i.e. the time between each value in the table 1 d) but the rate of the iteration of a while loop always will be the subject of a jig on a bone not real-time.

  • URGENT::opening multiple files - i have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    bbmChatDB of public database;

    public static FileConnection fconnRead = null;
    public static String fileReadData = "";
    public static InputStream is = null;
    data Byte [] = null;
    DataInputStream is = null;

    Here is my code...

    I have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    try {}

    FileConnection fc = Connector.open("file:///store/home/user/documents/BSM/") (FileConnection); "

    If (fc.exists ()) {}

    Enumeration e = fc.list ();

    While (e.hasMoreElements ()) {}

    System.out.println ("files are:" + (String) e.nextElement ());

    play this file
    StringBuffer stringBuff = new StringBuffer();
    try {}
    System.out.println ("opening file")-;
    System.out.println ("file name is:" + (String) e.nextElement ());
    fconnRead = Connector.open("file:///store/home/user/documents/BSM/(String)e.nextElement(),Connector.READ_WRITE) (FileConnection);
    System.out.println ("data length")-;
    If (fconnRead.exists ()) {}
    is = fconnRead.openDataInputStream ();
    data = IOUtilities.streamToBytes (is);
    Ddd = new String string (data);
    fileReadData = ddd.toString ();
    System.out.println ("length of data:" + fileReadData.length ());
    System.out.println ("read data :" + fileReadData);

    }

    } catch (IOException ee) {}
    ee.printStackTrace ();
    System.out.println ("Exception in the read data :")
    + ee.getMessage ());
    }

    }
    }

    } catch (IOException e) {}

    e.printStackTrace ();
    }

    {Finally

    try {}
    If (is! = null) {}
    is. Close();
    }
    System.out.println ("is closed...");
    } catch (IOException e1) {}

    E1. PrintStackTrace();
    }

    If (fconnRead! = null) {}
    try {}
    fconnRead.close ();
    } catch (Exception e) {}
    System.out.println (try ());
    }

    }

    }

    You can recode this treatment so that it uses only:

    e.nextElement ())

    Once a loop iteration.

    Directly at the start saying something like:

    String fileName = e.nextElement ());

    and use fileName everywhere in your loop.

    Also be aware that printStackTrace() will do nothing in your situation, it only works if you catch Throwable.  So make sure you something output all your catches exception and also have a catch (Throwable t) to catch the things you miss, as follows:

    {} catch (Throwable t)

    t.printStackTrace ();

    System.out.println ("Eception exception:" + t.toString ());

    }

    I think your code is thrown an exception and you don't see it.

  • Accelerate the selection * of a table

    Hi all

    OS: RHEL

    DB: 11 gR 2

    Is it possible that we can accelerate the selection * of a table?

    Kind regards

    $phinx19 wrote:

    Hi all

    OS: RHEL

    DB: 11 gR 2

    Is it possible that we can accelerate the selection * of a table?

    Kind regards

    # If it is everything you write, you get a full table scan independently of all the indexes that exist on this table:

    SQL > create table (yazflutt)

    snorm number 2.

    3 gleezle varchar2 (40),

    date of Halloween 4,

    Number 5 art);

    Table created.

    SQL >

    SQL > start

    2 for i in 1.10000 loop

    3. insert into yazflutt

    4 values (i, 'pourles yinko' |) I |'! (', sysdate - I, i);

    5 end of loop;

    6

    7 validation;

    8 end;

    9.

    PL/SQL procedure successfully completed.

    SQL >

    SQL > set autotrace on

    SQL >

    SQL > select * from yazflutt;

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    yinko 567 567 pourles!                        15 APRIL 14 567

    yinko 568 568 pourles!                        14 APRIL 14 568

    ...

    9982 yinko 9982 pourles!                       5 JULY 88 9982

    9983 pourles yinko 9983!                       4 JULY 88 9983

    9984 yinko 9984 pourles!                       3 JULY 88 9984

    9985 pourles yinko 9985!                       2 JULY 88 9985

    9986 yinko 9986 pourles!                       1 JULY 88 9986

    9987 yinko 9987 pourles!                       30 JUNE 88 9987

    9988 yinko 9988 pourles!                       29 JUNE 88 9988

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    9989 yinko 9989 pourles!                       9989 JUNE 28, 88

    yinko 9990 9990 pourles!                       JUNE 27 88 9990

    9991 yinko 9991 pourles!                       9991 26 JUNE 88

    9992 yinko 9992 pourles!                       25 JUNE 88 9992

    9993 yinko 9993 pourles!                       9993 JUNE 24, 88

    9994 yinko 9994 pourles!                       23 JUNE 88 9994

    9995 pourles yinko 9995!                       9995 22 JUNE 88

    yinko 9996 9996 pourles!                       JUNE 21 88 9996

    9997 yinko 9997 pourles!                       20 JUNE 88 9997

    9998 pourles yinko 9998!                       9998 19 JUNE 88

    yinko 9999 9999 pourles!                       18 JUNE 88 9999

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    10000 pourles 10000 yinko!                      JUNE 17, 88 10000

    10000 selected lines.

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2573332187

    ------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |          | 10000 |   556K |    10 (10) | 00:00:01 |

    |   1.  TABLE ACCESS FULL | YAZFLUTT | 10000 |   556K |    10 (10) | 00:00:01 |

    ------------------------------------------------------------------------------

    Note

    -----

    -the dynamic statistics used: dynamic sampling (level = 2)

    Statistics

    ----------------------------------------------------------

    9 recursive calls

    0 db block Gets

    795 consistent gets

    0 physical reads

    0 redo size

    488545 bytes sent via SQL * Net to client

    7877 bytes received via SQL * Net from client

    668 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    10000 rows processed

    SQL >

    SQL > set autotrace off

    SQL >

    SQL > create index yazflutt_idx1 on yazflutt (snorm);

    The index is created.

    SQL >

    SQL > create index yazflutt_idx2 on yazflutt (gleezle);

    The index is created.

    SQL >

    SQL > create index yazflutt_idx3 on yazflutt (hopple);

    The index is created.

    SQL >

    SQL > create index yazflutt_idx4 on yazflutt (art);

    The index is created.

    SQL >

    SQL > exec dbms_stats.gather_table_stats (user, 'YAZFLUTT',-online true waterfall, estimate_percent-online null)

    PL/SQL procedure successfully completed.

    SQL >

    SQL > set autotrace on

    SQL >

    SQL > select * from yazflutt;

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    yinko 567 567 pourles!                        15 APRIL 14 567

    yinko 568 568 pourles!                        14 APRIL 14 568

    yinko 569 569 pourles!                        APRIL 13, 14 569

    ...

    9983 pourles yinko 9983!                       4 JULY 88 9983

    9984 yinko 9984 pourles!                       3 JULY 88 9984

    9985 pourles yinko 9985!                       2 JULY 88 9985

    9986 yinko 9986 pourles!                       1 JULY 88 9986

    9987 yinko 9987 pourles!                       30 JUNE 88 9987

    9988 yinko 9988 pourles!                       29 JUNE 88 9988

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    9989 yinko 9989 pourles!                       9989 JUNE 28, 88

    yinko 9990 9990 pourles!                       JUNE 27 88 9990

    9991 yinko 9991 pourles!                       9991 26 JUNE 88

    9992 yinko 9992 pourles!                       25 JUNE 88 9992

    9993 yinko 9993 pourles!                       9993 JUNE 24, 88

    9994 yinko 9994 pourles!                       23 JUNE 88 9994

    9995 pourles yinko 9995!                       9995 22 JUNE 88

    yinko 9996 9996 pourles!                       JUNE 21 88 9996

    9997 yinko 9997 pourles!                       20 JUNE 88 9997

    9998 pourles yinko 9998!                       9998 19 JUNE 88

    yinko 9999 9999 pourles!                       18 JUNE 88 9999

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    10000 pourles 10000 yinko!                      JUNE 17, 88 10000

    10000 selected lines.

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2573332187

    ------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |          | 10000 |   341K |    10 (10) | 00:00:01 |

    |   1.  TABLE ACCESS FULL | YAZFLUTT | 10000 |   341K |    10 (10) | 00:00:01 |

    ------------------------------------------------------------------------------

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    0 db block Gets

    725 consistent gets

    0 physical reads

    0 redo size

    488545 bytes sent via SQL * Net to client

    7877 bytes received via SQL * Net from client

    668 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    10000 rows processed

    SQL >

    SQL > set autotrace off

    SQL >

    Whatever the index in place a ' select * ' makes a full table scan, period.  Unless you can optimize your storage space, memory, or even use version 11.2 laters results cache and there is not a lot you can do.

    David Fitzjarrell

  • Table query result using prepared as a parameter in the prepared statement later

    Hi all

    Very new to PHP. A series of 3 prepared statements (see code below), I'm trying to sink.  This page is triggered from a link on a page that lists the individual and all candidates which works well.  Prepared statement 1 works and displays the data in the columns line wanted specific, bottom access so I would call it record and areas, but I think it is called line and columns here.  Prepared Statement 2 which hands on a table of cross references (we have a many-to-many relationship between candidates and positions, therefore for the table of cross references) works and I can say the $selected_positions charges table, because I can see position_id data in the < body > of the file using this:

    <? PHP

    foreach ($selected_positions as $item) {}

    echo $item. "< br / > ';

    }

    ? >

    Can't take this $selected_positions table and use it as parameter in the prepared statement 3, at least not how I try to do.  So obviously he manages not prepared statement 3 no way is a table that I called $the_positions which is supposed to contain the ID of the post, position of securities and to position the position_id numbers that are in the array $selected_positions.  I can say that 3 of prepared statement is a failure because there is no indication in this table that is in the < body > of the file:

    < table class = "stripes table" >

    < b >

    Identification of the Position < /th > < th >

    < /Th > < th > post number

    Title < th > < /th >

    < /tr >

    <? PHP while ($stmt-> fetch()) {? >}

    < b >

    < td > <? = $position_id;? > < table >

    < td > <? = $position_number;? > < table >

    < td > <? = $title;? > < table >

    < /tr >

    <? PHP}? >

    < /table >

    Here is the PHP script:

    <? PHP

    require_once '... /includes/session_timeout_db.php';

    ? >

    <? PHP

    require_once '... /includes/Connection.php';

    initialize the flag

    $OK = false;

    $conn = dbConnect ('read');

    initialize statement

    $stmt = $conn-> stmt_init();

    If (isset($_GET['candidate_id'])) {}

    $sql = ' SELECT candidate_id, last_name, first_name, society, mas_number, last_modified, notes

    CANDIDATES WHERE candidate_id =?'; }

    If ($stmt-> {prepared ($sql))}

    bind the query parameter

    $stmt-> bind_param ('i', $_GET ['candidate_id']);

    run the query and fetch the result

    $OK = $stmt-> execute();

    bind the results to variables

    $stmt-> bind_result ($candidate_id, $last_name, $first_name, $company, $mas_number, $last_modified, $notes);

    $stmt-> fetch();

    free resources for the second query database

    $stmt-> free_result();

    }

    get the associated positions candidate

    $sql = 'SELECT position_id FROM pos2cands WHERE candidate_id =?';

    If ($stmt-> {prepared ($sql))}

    bind the query parameter

    $stmt-> bind_param ('i', $_GET ['candidate_id']);

    run the query and fetch the result

    $OK = $stmt-> execute();

    $stmt-> bind_result ($position_id);

    Browse the results to store in a table

    $selected_positions = [];

    While ($stmt-> fetch() {)}

    [] $selected_positions = $position_id;

    }

    }

    find data on the position of the table

    $sql = ' SELECT position_id, position_number, title

    FROM place WHERE position_id =?';

    If ($stmt-> {prepared ($sql))}

    bind the query parameter

    $stmt-> bind_param ('i', $_GET [$position_id]);

    run the query and fetch the result

    $OK = $stmt-> execute();

    bind the results to variables

    $stmt-> bind_result ($position_id, $position_number, $title);

    Browse the results to store in a table

    $the_positions = [];

    While ($stmt-> fetch() {)}

    [] $the_positions = $position_id;

    }

    }

    Get the error message if the request fails

    If (isset ($stmt) & &! $OK) {}

    $error = $stmt-> error;

    }

    If (! $stmt) {}

    $error = $conn-> error;

    } else {}

    $numRows = $stmt-> num_rows;

    }

    ? >

    Thank you in advancel

    You want to use the value of request 1 or query2 as a parameter in the query 3, right? Rather than build a table, you can simply use the value returned by each line that the query returns. I use PDO, no MySQLi, so I can't knock out quickly the MySQLi example for you.

    While ($result = $sql-> fetch (PDP::FETCH_ASSOC)) {}
    $field = $result ['domain'];

    Now we can use the value of $field as parameter for the next query.

    The brace that closes the while loop is placed after the last query

    so no need to fill an array with values

    }

    Your approach is doable with a few changes to the way in which you go through the table, but it is unnecessarily complicated.

    You might be able to use a single query to get all the data if you use left joins. With this approach, you start with the table that SHOULD return a result or which requires no dependencies to other tables. The structure is like this:

    SELECT field1, Field2, field3 FROM (SELECT * FROM table1 WHERE field3 = param1) has

    LEFT JOIN (SELECT * FROM table2 WHERE A.field4 = table2.field4) B

    LEFT JOIN table3 ON table3.field5 = B.field5 ORDER BY Field1

    A and B above are aliases for subsets of the table. You can image a (tacit) sign = equal A

Maybe you are looking for

  • QuickTime cannot open. MXF files?

    I use a panasonic HVX200 and I try to open the. MXF files, but quicktime says he can't.  I am running OS X Yosemite 10.10.5 on a 2008 macbook pro (15-inch)

  • my "computer cannot communicate with the printer.

    All of a sudden my computer stopped communicating with my printer or wireless or wired.

  • How can I find a bad driver?

    My computer keeps trying to install new hardware on each pie upward.  The search for new hardware wizard cannot find.  I didn't install any hardware and MS says it's a bad driver.  How to find a driver who's?  I tried to fix the Center.

  • ACS Remote Agent

    HI guys,. I installed the Remote Agent ACS on my AD controller. I can add the agent to ACS... but I do not see the Windows authentication avaiable in the agent... The Agent runs with a service account that has all rights AD. Anyone able to help?

  • Installing AnyConnect Mobile licenses

    I want to clarify how exactly a Cisco AnyConnect Mobile license is applied to an ASA. Does as a PAK and then a license key is created? Y at - it a separate to enter specifically for the mobile command?