Extract results from database

I want to be able to re-create a test report from the results database and do statistical analysis on the results of specific tests. Are there any querries or other database tools that have already been developed for this?

Hi Gumby,
As far I know there aren't any tools developed specifically for this kind of a task. However depending on the environment you're using there will probably be tools developed for easily retrieving information from databases.
In TestStand we have SQL step types that allow you to easily retrieve data from databases. There are two examples that ship with TestStand I would suggest looking at in addition to the help for these step types.
C:\Program Files\National Instruments\TestStand 3.1\Examples\Database
(This path will vary depending on the version of TestStand and your installation directory.)
If you're using LabVIEW or LabWindows/CVI we have special tools developed to simplify communicating to databases.
c.vp?cid=6429〈=US>LabVIEW Database Connectivity Toolkit
NI LabWindows/CVI Enterprise Connectivity Toolset
There are also lots of examples available by searching our website.
If you're using another environment there are probably tools available as well, I just don't know enough to recommend any.
I hope this helps!
Regards,
Sarah Miracle
National Instruments

Similar Messages

  • How to extract data from database to XSLT?

    I want to generate a report by XSLT, but the data is extracted from the database. I will use Access/SQL server for my database. Can i write SQL in XSLT to extract data from database? Have any sample code or reference website to show how it work?
    THX

    for example: "SELECT code, name FROM TABLE FOR XML RAW"
    String xml = null;
    if(rs.next()){
      xml = rs.getString(1);
    }You will get xml string something like this:
    <row empID="1234"/><row empID="1235"/>
    You can construct a DOM using this xml data and operate on it.
    However you may explore more on resulting xml format.
    A different SQL Query (rather than using XML RAW) may give output in a more desired format.

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

  • Extract data from database to xml ?

    is there any API, classes or tools ready to extract data from oracle database and generate xml files, Instead to implement a DOM class and build little by little the xml file??
    thanks for every info in advance.

    Yes, download the Oracle XML Development Kit from Oracle's website and look at the documentation of the XML-SQL Utility.

  • Extract HTML from database

    How can i extract data from a database that has html or
    coldfusion language in it. My browser keeps trying to process it. I
    want to display it as raw text.

    Also you may follow this tutorial at,
    http://tutorial92.easycfm.com/

  • Error While Extract results from OBIEE 11g Prest. Service to External apps.

    Need a urgent help
    I am using java to connect to OBIEE's  11g SOAP-API and trying to pull Graph’s in External Application.
    I have successfully been able to connect to the API, create an HtmlViewServiceSoap object, and use a combination of the following methods to pull HTML & Javascript Content and write to a file through this all methods: addReportToPage, getHeadersHTML, and getHTMLForReport.
    But while executing the respective URL got from getHeadersHTML ,getHTMLForReport function it gives ‘EmptyResponse’ alert message. Actually, The URL got from getHTMLForReport i.e. reportObject.setAjaxGoUrl does not Hit to Bridge Servlet, So in the application only the Searching image appears with ‘EmptyResponse’ alert message .
    We are Successfully able to render graphs using OBIEE's  10g SOAP-API HtmlViewServiceSoap service and getHeadersHTML ,getHTMLForReport function in External Application.
    Please let me Know the solution ASAP for extracting Graph from OBIEE's 11g SOAP-API
    Edited by: user13351567 on Jul 1, 2011 12:49 AM

    Hi all
    João, could you please explain how did you solved that network problem? I'm having a similar error establishing a Site Studio connection: 'Design time connection error: java.net.SocketTimeoutException: Read timed out'
    If I create this connection from a JDeveloper installed in the machine where UCM, WebCenter and SSXA are installed there's no connection problem. The problem only occurs in others pcs in the same network.
    Thank you in advance

  • Extracting results from converted VBAI inspection

    Hi everyone,
    I have recently converted a VBAI inspection and migrated it to LabView. The Labview file is attached, and from this , I would to extrapollate the results I get, and put them under excel (any type of spreadsheet really).
    I'm not to sure where to extrapollate the results from, but i seemed to think it was on the top left loop, on the third sector label. Everything works fine in my VI, but when I put the path to which I would like the results to be sent to, and I already created a text file in a folder, so I was selecting this text file as my new spreadsheet for these results, but nothing happens, the spreadsheet stays white.
    Maybe I havent understood how to use the "write to spreadsheet" or how to actually save data, but if any one could help me, it would be greatly appreciated.
    Best regards
    Attachments:
    Inspect Main (Server).vi ‏125 KB

    The camera is a special thermal camera that was bought through a company that developped a few drivers along with it. unfortunately, I don t have the SDK, therefore     I am not sure how the drivers were written. They have developped drivers only for labview,and I can therefore not acquire the camera neither on VBAI nor on VAS. 
    I would therefore like to say that if I could acquire in VBAI, no I probably wouldn't have to igrate, but I really can't unfortunately. The only way I have figured out how to use the camera, is throgh MAX, configurating it as a Visa resource and then acquiring it in the Visa resource name and then using the drivers such as "initialize"...
    Sorry if that's not so clear, it's a bit hard to exlain.
    Thanks very much

  • Same query takes different time to fetch result from Database

    Hi all,
    I am having a scenario in which a query is taking different time keeping other environmental variables constant.
    When that query runs for 1 user it takes just 2 minutes to fetch result and the DB connection becomes inactive after fetching the result.
    But if I run the same query after some time in similar environment it takes 25 minutes. sometimes 40 minutes to execute and give the result to the app server from the same database.
    I am not able to understand this behavior from DB. Can anybody try to explain this behavior?
    The details of the DB are,
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    OS Details:
    Windows 2008 server Enterprise Edition.
    I tried analyzing that query in oracle, it recommended there are lots of hard parsing in that query.
    Regards,

    user10915512 wrote:
    Hi all,
    I am having a scenario in which a query is taking different time keeping other environmental variables constant.
    When that query runs for 1 user it takes just 2 minutes to fetch result and the DB connection becomes inactive after fetching the result.
    But if I run the same query after some time in similar environmentBut not exactly the same environment. So what is different that it is only "similar"?
    it takes 25 minutes. sometimes 40 minutes to execute and give the result to the app server from the same database.
    I am not able to understand this behavior from DB. Can anybody try to explain this behavior?Run a statspack on the 'well behaved' query and on the 'not well behaved' query. Compare and contrast the results.
    >
    The details of the DB are,
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    OS Details:
    Windows 2008 server Enterprise Edition. To paraphrase Forest Gump, "My momma always said Windows was like a box of chocolates ...."
    >
    >
    I tried analyzing that query in oracle, it recommended there are lots of hard parsing in that query.
    Regards,

  • Help in obtaining results from database

    i have a column containing value as abc's
    but when i retrieve this value from the database using
    rs.getString("columnname")
    i get only abc and not abc's.
    what is the problem

    here is the code:
    topicname in the database contains value say "abc's"
    String sqlstring="select topicname,topictype from topiclist where listno=?";
              PreparedStatement selectstatement=connection.prepareStatement(sqlstring);
              selectstatement.setString(1,listno);
              ResultSet rs=selectstatement.executeQuery();
              if (rs.next())
                   topic=rs.getString("topicname");
                   type=rs.getString("topictype");
                   rs.close();
    the result that is stored in topic is only abc and not abc's
    thank u

  • Extracting data from database table containg perticular string.

    hi every body ,
    can any body provide me a solution for extracting the OT01 data from kna1 table where the OT01 ends with the string 'town' .
    exe : the O/P should be
    midTOWN
    newTOWN
    there is one more query i am not able to execute the following statement .......why?
    select ORT01 from KNA1 where ORT01 CS 'TOWN'.
    write:/ kna1-ort01.
    endselect.
    it is showing a syntax error.......
    Thank You.

    Hi Tippu,
    Your select statement consists of CS whcih may not be a valid comparision operator because of which error is displayed have look of this..
    data itab like kna1 occurs 0 with header line.
    parameters: s_town like kna1-ORT01.
    select ORT01 from KNA1 into table itab where ORT01 = s_town.
    Fetch the city and concatenate with TOWN your issue will be sloved.
    Cheers!!
    Balu
    Edited by: Balu CH on Oct 21, 2008 11:13 PM

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

  • Extract DDL from Database

    Hi all,
    I am trying to extract the DDL statements for my database indexes. I am using Oracle 8i. The two option:
    (1) You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings.
    (2) DBMS_METADATA.GET_DDL but it is only available for Oracle 9i and above. So it does me not good.
    Are there any other option beside (1) that I can use in Oracle 8i. Any suggestion would be appreciated.
    Thanks,
    Ravi

    You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings.You haven't mentioned the OS.
    you can create the indexfile(ddl file) and remove the quoted strings using global replacement and you would have a clean SQL file with DDL's.

  • Get results from database for the last one week ?

    Hi All,
    I have to make a query for retrieving the data for the last one week from a table say "Orderdata".
    So can anybody please tell me how to retrieve date of last weak from the current date. I mean if current date is 12/08/2004 (mm/dd/yyyy) then I would be needing date as :--
    12/01/2004 (mm/dd/yyyy) to 12/07/2004 (mm/dd/yyyy).
    To more clear, here is the query that am using :
    select * from orderdata where orderdate between 12/01/2004 AND 12/07/2004
    I know I would be needing java.sql.timestamp class to set date . but it is the last thing to do .
    First I have to get date of last weak...........
    Here is the code----------that i have just start to write ..
    Calendar cal;
    TimeZone tz;
    String estTimezone="GMT-05:00";
    tz=TimeZone.getTimeZone(estTimezone);
    cal=new GregorianCalendar(tz);
    cal.setTimeZone(tz);
    String currentdate=String.valueOf(cal.get(Calendar.MONTH)+1);
    currentdate+="/"+String.valueOf(cal.get(Calendar.DAY_OF_MONTH)-1);
    currentdate+="/"+String.valueOf(cal.get(Calendar.YEAR));
    out.println(currentdate);And assume if current date is 12/1/2004 (mm/dd/yyyy) then subtracting -1 form the current date will give 12/00/2004 so not getting the correct result .
    Hope it is clear to all................
    Please Help !
    amitindia

    http://forum.java.sun.com/thread.jspa?threadID=577953&tstart=0

  • Extracting Permissions from database in JAAS

    I am working on enterprise application where we want to implement JAAS and extract the permissions and roles from the data base but not from the policy file.Can any body post me the solution.

    Hi, raghave66!
    You should read the documents below.
    http://java.sun.com/j2se/1.4/docs/guide/security/PolicyFiles.html
    You'll have to create your own Policy Class instead of
    using default com.sun.security.auth.PolicyFile.class
    regards,
    kt

  • Want to display results from database pagewise ?

    I have 500 records in the sql server 2000 then i query and retrieve them in a resultsets. and then i want to display 10 records per page having the facility to navigate to the Previous and Next Record also going to first and the last record.
    like we are using when we navigate from this forum
    FIRST PREVIOUS 1 2 3 4 5 6 7 8 9 10 NEXT LAST
    secondly if their is a possiblity their should be a search page to to specific page like this
    Go To this Page (Textfield)
    third thing when i am on first record the it shouldnt show PREVIOUS button and when it is in the last it should not show NEXT.
    this thing should be done by Using JSP , Servelets and Beans...
    and PLEASE DONT SAY THAT IT HAS ALREADY BEEN ASK IF SO TELL ME THE LINK BECAUSE I CANT FIND ANYWHERE IN THE FORUM SO PLEASE TRY TO PROVIDE THE SOURCODE OR ATLEAST A REFERENCE FOR IT.

    for your task there is nice keyword in MySQL:
    LIMIT [offset,] rows
    maybe MSSQL has something similar...
    though i haven't seen such a keyword in oracle nor postgre... nor mssql (but i haven't looked for it from there...)
    one way would be to skip first X results in resultset... in PyML i have used method .skip(count) for skiping count rows, but i'm not sure that in java there is equivalent for that, so you might have to just call ResultSet.next() for count times, and then ten more times to get desired data for your page.

Maybe you are looking for