Save array data

Hi all,
I need help to solve a problem like following.
I have a table 'results' with the columns
result_id number PK
method varchar2(200)
readout varchar2(60)
result number
Also I have built a page with an array (realized through text fields) like this one:
x1_1 x1_2
x2_1 x2_2
x3_1 x3_2
x100_1 x100_2
All elements in the array have the same method. In column readout the name of the array element has to be stored. The input of the text fields have to be stored in column result.
I think an example makes it more clearly
method = malinoe
x1_1 = 15 x1_2 = 9
x2_1 = 3 x2_2 = 7
x3_1 = 10 x3_2 = 11
x100_1 = 2 x100_2 = 3
After fill in the values into the text field array you have to click the Button 'SAVE' and all values have to be stored in the table results:
first row:
result_id = 1
method = malinoe
readout = x1_1
result = 15
second row:
result_id = 2
method = malinoe
readout = x1_2
result = 9
third row:
result_id = 3
method = malinoe
readout = x2_1
result = 3
last row:
result_id = 200
method = malinoe
readout = x100_2
result = 3
Has anybody an working example or idea how I can solve this problem?
Thanks for help,
ben
Message was edited by:
ben512

I think that here is the best approach htmldb_collection.
On load form fill the text items with data.
On save fill the collection elements and then iterating through them save them in table.
Here is QBE code for iteratiting through forms controls and if some control has name P||PAGE_ID_FIELD_NAME then this is ok control...Use just the logic of iteration through form items.
Here is example from my source code:
FUNCTION QBE (
        ln_page_id     NUMBER
      , ls_table    IN VARCHAR2
      , ls_select   IN VARCHAR2 DEFAULT NULL
      , ls_where    IN VARCHAR2 DEFAULT NULL
      , ls_order_by IN VARCHAR2 DEFAULT NULL
      , ln_search_type NUMBER   DEFAULT 3
      , ls_scope_mode  VARCHAR  DEFAULT 'U' 
          ) RETURN VARCHAR2
   AS  
     wrong_search_type EXCEPTION;
     wrong_date_field EXCEPTION;                
     wrong_scope_mode EXCEPTION;
    ls_sql       VARCHAR2 (32567 CHAR);
    lb_need_and  BOOLEAN := FALSE;
    lb_has_where BOOLEAN := FALSE;
    ls_field_name VARCHAR2 (128);
    lb_process_current_field BOOLEAN;
    lb_is_date_field BOOLEAN;
    -- lb_is_date_time_field BOOLEAN;
    lb_is_number_field BOOLEAN;
    lb_is_LOV BOOLEAN;
    lb_is_date_from BOOLEAN;
    c_collection VARCHAR2(32 CHAR) := 'DATE_USED_FROM'; 
   BEGIN
     HTMLDB_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION (c_collection);
     IF ls_scope_mode NOT IN ('U','A') THEN
       RAISE wrong_scope_mode;
     END IF;
      -- Create SELECT part of SQL Statement
      IF (ls_select IS NOT NULL) THEN
        ls_sql := ls_select;
      ELSE
        ls_sql := 'SELECT *';
      END IF;
      -- Create WHERE part of SQL Statement
      IF (ls_where IS NOT NULL) THEN
        ls_sql := ls_sql || ' from ' || ls_table || ' ' || ls_where || ' and ';
      ELSE
        ls_sql := ls_sql || ' from ' || ls_table || ' where ';
      END IF;
      -- Loop through each column in the table specified in ls_table and see if there is a corresponding
      --   HTML DB page item on the page specified in ln_page_id
      FOR x IN (SELECT column_name, data_type FROM USER_TAB_COLUMNS WHERE table_name = UPPER(ls_table) AND ls_scope_mode = 'U'
                UNION 
                SELECT column_name, data_type FROM ALL_TAB_COLUMNS WHERE table_name = UPPER(ls_table) AND ls_scope_mode = 'A') LOOP
        lb_is_date_field := FALSE;
        lb_is_number_field := FALSE;   
        --lb_is_date_time_field := FALSE;
        ls_field_name := 'P' || ln_page_id || '_' || x.column_name;
        <<PLAY_IT_AGAIN_SAM>>
        IF x.data_type = 'DATE' THEN
          lb_is_date_field := TRUE;
          ls_field_name := 'P' || ln_page_id || '_' || x.column_name|| '_FROM';
          lb_process_current_field := TRUE;
          lb_is_date_from := TRUE;
          FOR j IN (SELECT c001 FROM htmldb_collections WHERE collection_name = c_collection) LOOP
            IF j.C001 = ls_field_name THEN
              lb_process_current_field := FALSE;
              EXIT;
            END IF;
          END LOOP;
          IF lb_process_current_field THEN
             HTMLDB_COLLECTION.ADD_MEMBER (p_collection_name => c_collection
                                         , p_c001            => ls_field_name
                                         , p_generate_md5    => 'NO');
          ELSE
            ls_field_name := 'P' || ln_page_id || '_' || x.column_name|| '_TO';
            lb_process_current_field := TRUE;
            lb_is_date_from := FALSE;
                 FOR j IN (SELECT c001 FROM htmldb_collections WHERE collection_name = c_collection) LOOP
                   IF j.C001 = ls_field_name THEN
                     lb_process_current_field := FALSE;
                     EXIT;
                   END IF;
                 END LOOP;
             IF lb_process_current_field THEN
                HTMLDB_COLLECTION.ADD_MEMBER (p_collection_name => c_collection
                                            , p_c001            => ls_field_name
                                            , p_generate_md5    => 'NO');
             END IF;
          END IF;
          lb_process_current_field := V(ls_field_name) IS NOT NULL;
        ELSIF IS_NUMBER (V(ls_field_name) ) THEN
          lb_process_current_field := (V(ls_field_name) != -100);
          lb_is_number_field := TRUE;
        ELSE -- ovo je za sve ostale!
          lb_process_current_field := (V(ls_field_name) IS NOT NULL) AND NOT (V(ls_field_name) IN ('-100','%null%','null'));
        END IF;
        IF lb_process_current_field THEN
           .... then do your work....Of course you must obey naming convention - what I can see you have done that so your control name is like:
x1_1 xi_2.
Hope this helps

Similar Messages

  • How do I automatically save array data to a spreadsheet?

    I am setting up a 24 hour test where I would like the gathered array data to automatically save to a spreadsheet every 4 hours. Is there a way to set this up with the Write to Spreadsheet file.vi?
    Solved!
    Go to Solution.

    Sure, you just need a timer that will  tell you when the 4 hours are up.  Take a look at the attached timer, I picked it up on these forums a while ago but I cant remeber who to give credit to for it*.  Just use this timer to trigger a case structure holding the write to spreadsheet function.
    *It is from Bloomy controls
    Message Edited by jmcbee on 03-17-2009 09:39 AM
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Interval Timer.vi ‏21 KB
    Delta Time.vi ‏22 KB

  • Save waveform data with corresponding time array to spreadsheet file

    Hello to all
    I am looking for a possibility to save voltage data acquired and displayed continousely to a spreadsheet file. Acquiring and displaying is not a big problem, but I have troubble to save the data with the corresponding timestamp with more than seconds accuracy. I am acquiring the data at 1000 Hz and read packages of 500 samples. The recording time should not be limited, it will be started and stopped manually. In fact the acquired voltage data first has to be scaled and than saved. If I use the 'WRITE WAVEFORM TO SPREADSHEET' VI the time column is in seconds' accuracy and that is not what I need. If I create my own time array from the waveform parameters I have timing problems. The accuracy in time should reflect the sample rate. I will attach one of my not very successful trials for better understanding.
    please help a newcomer!
    Thanks in advance
    Thomas
    LV 7.1
    Attachments:
    display & record forces v.1.0.vi ‏181 KB

    I usually follow a simple method to generate time stamp
    I keep sampling rate and number of samples to read as equal and do as shown in the attached VI
    I also remember building a VI with a small modification to this time stamp generation logic to cater to acq, where number of samples to read is half/one fourth/one tenth of sampling rate specified, but cannot find that VI.
    Hope this helps
    Regards
    Dev
    Attachments:
    Acq_DAQmx_filesave_time stamp.vi ‏121 KB

  • How to save the data from AI Read.vi?

    Hi,
    The main target is that testing the strength of a object which is extended by a force. The desired results are
    1. The strength of object under the force(main target, I am trying now);
    2. Displacement of object being extended(I have mimicly done);
    3. Images of deformation of the object extended(I have mimicly done).
    4. The sub procedure will stop when the object under testing is broken. I intend to use the big pulse from force sensor by analizing the data acquired.( it is more difficult if using machine vision).
    What I am mainly trying to do now is implementation of a sub vi to collect the data which is acquired from channel 0 of PCI-6052E which is connected to a force sensor. I have tried to use an existing exam
    ple as attached with some modifications. I have tested the data from the sensor by comparing to measurement by multimeter and it takes sense. But
    1. I still don't know how to save data displayed by AI Read.vi? And use what kind data type could save more memory?
    2. I think that memory management is very important because each points of the result includes its strength, image and displacement. How can I acquire enough significant points for the final results being reliable and save these data down to an array or cluster synchronously? (each sub procedure has no time limited)
    3.Because I think that a continuous data acquisition would occupy ALL CPU TIME and their related images and displacements would have no chance to be taken down by CPU at the same moment. Am I right?--I am sure that it is not very difficult problem but my mind is still in caose and the time is quite limited to me now.
    I am looking for your sugguestion or solution or control philosophy too. You can modify the fi
    le attached if you can. I will learn from your idea.
    Thank you very much for your time and energy!
    Your
    Swedlin
    Attachments:
    Acquire_N_Scans_1_10.vi ‏75 KB

    Hello;
    Regarding your question on the data type that would use less storage space, the answer is binary type. Actually, you can use another shipping example as start point of your application. The example I'm mentioning is a data logger, that saves binary data to a file on your hard drive. You can find that example at Search Examples->I/O Interfaces->Data Acquisition->Data Logger->High Speed Data Logger.
    Regarding your question about the CPU time, the statement is valid. In case you use a synchronous AI task, the CPU execution will get stuck inside the AI Read.vi untill the buffer is ready to be read. One thing you can do about that is to change the acquisition task to be asynchronous. There is a good example in Labview showing how you can accomplish that.
    You can find the example at Search Examples->I/O Interfaces->Data Acquisition->Analog Input->DAQ Occurrences.
    You can combine both examples to accomplish the task you need.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • How to save the data that a user has written in a table (front panel) by using a "press button"?

    Hi,
    I have the following situation. I need to be able to save the data I write in a table (front panel) when desired.
    This allows me to modify, add new data, etc in the "Table" when wanted and to SAVE the latest information when wanted.
    I need to save all the table data by using ONLY one button.
    Thanks for the help!
    Kind regards,
    Amaloa S.

    Hi,
    Thanks for the feedback. :-)
    Your answered helped.
    In this case I need to save the Data into an ARRAY.
    Now I have the following issue. I will try to explain:
    Suppose that I have following:
    1. Several GROUPS of Data like this:
        ER-1234
        ER-3245
        ER-4786
        ER-9080
    2. Each GROUP has the following ELEMENTS:
        A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
       So it would be like
        ER-1234: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
        ER-3245: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
        ER-4786: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
        ER-9080: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
     3. An each ELEMENT has DATA that I need to save, BUT! that I need to be able to get by specifying the group and the element.
        A:
             2,3   2,4    2, 8,   2,8 
             2,2   2,3    2, 7,   2,6
             2,1   2,6    2, 6,   2,7 
             2,5   2,4    2, 5,   2,3
    How can I save the ELEMENT "A" Data with the label of the GROUP and the ELEMENT so that I can recongnize it when I need to get the DATA again?
    Thanks for the help!
    Best regards,
    Amaloa.

  • Save Session Data

    Hi to all,
    is there a way to save Session Data in  a Bsp application (similar to Php $_SESSION array)?
    or i have to use shared object/export-import memory id  to save temp data in a session (example: Shopping Cart)?
    thanks
    Alessandro

    Hello,
    you can use a statefull bsp with an application class...
    The objects in the class have a lifetime over the whole session.
    regards

  • Trying to save array database

    I'm having difficulty saving my database and restoring for my array. I think the problem is that I used the ArrayList class rather than making my own. I know how to do a save if I make the array, but I can't seem to get it to work with the ArrayList class. I'm required to use the ArrayList class for my array rather than make my own, but I also need to have the ability to save. If anyone has the time, I'd really appreciate some input
    Thanks
    MAIN:
    import java.util.*;
    import javax.swing.*;
    public class SquiresProject1 {
         public static void main(String[] args) throws Exception {
              int menuCode, add, delete;
              boolean search = false, repeat = false, done = false;
              String saveChoice;
              //new record meant for an array of 10 in CreativeResources
             ArrayList customer = new ArrayList(10);
              SquiresSave save = new SquiresSave();
             //open file with saved data
              //control loop - enter 0 when finished
             while (!done) {
                   //prompt, get menuCode, parse into an integer
                  menuCode = Integer.parseInt(JOptionPane.showInputDialog(null,
                       "1. Add customer"
                            + "\n2. Delete customer"
                                 + "\n3. Search for a customer"
                                      + "\n4. List all customers"
                                           + "\n5. Save your progress"
                                                + "\n6. Restore from last save point"
                                                     + "\n **Enter 0 to end program**"
                                                          + "\n Please enter a choice: "));
                   switch (menuCode) {
                        //end loop and program
                        case 0:
                             done = true;
                             break;
                        //search for duplicates and add customer
                        case 1:
                             String customerToAdd = JOptionPane.showInputDialog(null,
                                  "Customer's name: ");
                             repeat = customer.contains(customerToAdd);
                             if (repeat == false){
                             customer.add(customerToAdd);
                             JOptionPane.showMessageDialog(null, customerToAdd + " was successfully added to the list");
                             else
                             JOptionPane.showMessageDialog(null, "Sorry, but " + customerToAdd + " is already in the list");
                                                      break;
                        //sort, search for and delete customer
                        case 2:
                             String customerToDelete = JOptionPane.showInputDialog(null,
                                  "Customer to delete: ");
                             customer.remove(customerToDelete);
                             JOptionPane.showMessageDialog(null, customerToDelete + " was successfully removed");
                             break;
                        //sort, search for customer
                        case 3:
                        String customerToSearch = JOptionPane.showInputDialog(null,
                                  "Customer to search for: ");
                             search = customer.contains(customerToSearch);
                             if (search == true){
                             JOptionPane.showMessageDialog(null, customerToSearch + " is in the database");
                             delete = JOptionPane.showConfirmDialog(null, "would you like to delete " + customerToSearch + "?", "Run Again Dialog",     JOptionPane.YES_NO_OPTION);
                                  if (delete == JOptionPane.YES_OPTION){
                                customer.remove(customerToSearch);
                                  JOptionPane.showMessageDialog(null, customerToSearch + " was successfully removed");
                             else
                             JOptionPane.showMessageDialog(null, "Sorry, but " + customerToSearch + " is not in the database");
                             break;
                        //sort, traverse and list array
                        case 4:
                                  JOptionPane.showMessageDialog(null, customer.toArray());
                                                      break;
                        //sort, save progress
                        case 5:
                        save.saveData();
                                                      break;
                        //restore from last save
                        case 6:
                             save.restoreData();
                             break;
                        //invalid choice - ask for input again
                        default:
                             JOptionPane.showMessageDialog(null, "Bad input. Read the choices carefully!");
              //prompt to save data
              saveChoice = JOptionPane.showInputDialog(null,
                   "Would you like to save your data? y/n?");
              if ((saveChoice.equalsIgnoreCase("y")) || (saveChoice.equalsIgnoreCase("yes"))) {
                   save.saveData();
              else
                   JOptionPane.showMessageDialog(null, "You chose not to save your data.\nData not saved!");
              //closing
              JOptionPane.showMessageDialog(null, "Program ending.  Have a nice day!");
    }MY ATTEMPT AT A SAVE/RESTORE METHOD CLASS:
    import java.io.*;
    import java.util.*;
    public class SquiresSave{
    public static int DEFAULT_SIZE = 10;
    private int countOfCustomers;
    private String[] customers;
    private int customerPosition;
         public SquiresSave(int maxCustomers) {
              customers = new String[maxCustomers];
              countOfCustomers = 0;
              customerPosition = 0;
         //constructor
         public SquiresSave() {
              customers = new String[DEFAULT_SIZE];
              countOfCustomers = 0;
              customerPosition = 0;
         public void saveData() {
              int writeCount = 0;
              try {
                   //open database.txt and write array to it
                   PrintWriter outputStream = new PrintWriter(new FileOutputStream("database.txt"));
                   while (writeCount < (countOfCustomers)) {
                        outputStream.println(customers[writeCount]);
                        writeCount++;
                   //close database.txt
                   outputStream.close();
                   System.out.println("Data saved to file: database.txt");
              //catches all IOException errors
              catch (IOException e) {
                   System.out.println("Error writing to file database.txt.\nData not saved!");
    ////////////////////////////////////restores data///////////////////////////////////////
         public void restoreData() {
              try {
                   //open database.txt
                   BufferedReader inputStream = new BufferedReader(
                        new FileReader("database.txt"));
                   String line = inputStream.readLine();
                   countOfCustomers = 0;
                   //read and assign lines to customers until customers is full or file is completely read
                   while ((line != null) && (countOfCustomers < customers.length)) {
                        customers[countOfCustomers] = line;
                        countOfCustomers++;
                        line = inputStream.readLine();
                   inputStream.close();
                   System.out.println("Data restored from file database.txt");
              catch(FileNotFoundException e) {
                   System.out.println("Error reading input file: database.txt.\nData not restored!");
              catch(IOException e) {
                   System.out.println("Error reading data from database.txt.\nData not restored!");
    }

    Hi,
    at first you have to pass the data to your save method and get it from your restore method. You can do that simply with a argument in the methods. See http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html.
    In your example, you could use
                        //sort, save progress
                        case 5:
                             save.saveData(customer);
                             break;
                        //restore from last save
                        case 6:
                             save.restoreData(customer);
                             break;
    ...Then your save/restore methody could look like:
         public void saveData(ArrayList<String> customer) {
              try {
                   //open database.txt and write array to it
                   PrintWriter outputStream = new PrintWriter(new FileOutputStream("database.txt"));
                   for (ListIterator i = customer. listIterator(); i.hasNext();) {
                        outputStream.println((String)i.next());
                   //close database.txt
                   outputStream.close();
                   System.out.println("Data saved to file: database.txt");
              //catches all IOException errors
              catch (IOException e) {
                   System.out.println("Error writing to file database.txt.\nData not saved!");
    ////////////////////////////////////restores data///////////////////////////////////////
         public void restoreData(ArrayList<String> customer) {
              try {
                   //open database.txt
                   BufferedReader inputStream = new BufferedReader(
                        new FileReader("database.txt"));
                   String line = "";
                                        customer.clear();
                   //read and assign lines to customers until customers is full or file is completely read
                   while ((line = inputStream.readLine()) != null) {
                                           customer.add(line);
                   inputStream.close();
                   System.out.println("Data restored from file database.txt");
              catch(FileNotFoundException e) {
                   System.out.println("Error reading input file: database.txt.\nData not restored!");
              catch(IOException e) {
                   System.out.println("Error reading data from database.txt.\nData not restored!");
    ...And please deal with generics. See http://java.sun.com/docs/books/tutorial/extra/generics/index.html. Then you can declare the ArrayList better as ArraList<String>.
    greetings
    Axel
    Edited by: Axel_Richter on Sep 22, 2007 8:48 AM

  • How do i save the data in table ??? URGENT

    how do i save the data in table ???  URGENT
    Hope can attach some example VI for reference =]
    Attachments:
    data in table.JPG ‏271 KB
    block diagram.JPG ‏459 KB

    You didn't mention which version of LabVIEW you are using. I adapted your method in this example. Not sure this is an efficient method. I just pass the 2d array through in the false case.
    Using LabVIEW 2010SP1 and TestStand 4.5
    Attachments:
    WriteTable.PNG ‏35 KB

  • How can i save a data in text format

    how can i save a data in text format in labwindows cvi
    Message Edited by Tikoy on 04-14-2010 11:30 PM
    Solved!
    Go to Solution.

    Hi,
    If your data is in an array, the easiest way is to use the ArrayToFile function.
    It automatically creates a file and puts your data in it according to the format you provide.
    If you have individual samples that you need to write once in a while, you can either collect them into an array and then use ArrayToFile or open a file with fopen and write them as they are acquired with fwrite.
    Hope this helps, 
    S. Eren BALCI
    www.aselsan.com.tr

  • Nested IPE (In Place Element) usage when accessing Cluster/Array data via DVR

    I am sharing data across several VIs and loops via a DVR, and accessing the data via a DVR IPE. The data is a cluster of arrays. The diagram below (VI attached) illustrates the structures invloved, but not the structure of the application.
    (The diagram above does not include initialization of the arrays, as it is intended only to illustrate the Cluster1 data type. Array lengths could be 100.)
    The DVR (DVR1) is passed to multiple VIs of the application at startup.
    Each VI executes loops that either read or write particular elements of each array (fArray1 or fArray2).
    I believe the DVR IPE (B1-DVR) provides blocking so that only one task can modify the data (Cluster1) at any time.
    Case 1 illustrates how I currently WRITE to array elements. The outer IPE (block B1) is rolled into a VI (not shown) that takes DVR1, Index, and Value as inputs.
    Cases 2 - 4 illustrate 3 additional methods that remove one or both of the inner IPEs (B2-Cluster and B3-Array).
    Case 2: IPE B3 (Array Index/Replace Elements) is replaced with a non-IPE 'Replace Array Subset'.'
    Case 3: IPE B2 (Unbundle / Bundle Elemnts)' is replaced with a non-IPE cluster 'Unbundle'/'Bundle'.
    Case 4: removes both B2 and B3.
    I implemented case 1 a long time ago.  When I had to do the same thing again recently, I did case 4.  When I stumbled across my earlier implementation, I was a bit suprised
    Which of the 4 cases should take the least time (or resources) to execute? I think case 4 has as few array allocations as any of the other 3.
    The attached image did not capture the Buffer Allocation marks, so I marked the ones that differed with a red "B".
    I am only interested in differences in how the arrays are handled, so I see no signioficant differences.
    Is this one of those cases where LV doesn't need my help?
    Incidently, I recently wrote a small app with shared data and decided to try FGVs to share array data.  For small arrays, 10^7 iterations, and an FGV based array-element read followed by a element write, the FGV was faster.  1.2us per read/write for FGV vs 3us per r/w for an DVR/IPE based read/write (like above).
    Peter
    LV 2011 SP1, Windows 7 64-Bit
    Attachments:
    IPE.vi ‏9 KB

    Option 1 is a definite no and as far as I know it has been NI's explicit intention to steer clear from it. I believe there's an idea in the IE which asks for this.
    I agree that option 2 makes sense, but I don't think it should be something the user specifies. Either LV can detect it automatically or it can't, but I doubt NI would let you have an option which creates the possibility for this kind of bug.
    I'm not sure, but the mark as modifier option on the IPES might be the option you're looking for. I know that it exists and I know very roughly what it does, but the documentation for it is very limited and I never actually played around with it, as usually I don't need these kinds of optimizations.
    You may well be right that a new option on the IPES is desirable and you should probably add it to the idea exchange.
    As for NIWeek, I'm not going this year, so I have no idea what kinds of sessions are around, but it's a great place to find people who know what they're talking about and ask them about it directly. Certain people in LV R&D would probably be ideal for this and if you ask relevant people, you might even get their names. I'm sure buying them a beer would also help to loosen their tounges. If you ask me, this type of interaction is the main value of the conference, not the sessions themselves.
    Try to take over the world!

  • Unable to Save the Data Using BexSetData

    Hi All,
    I have a issue regarding saving plan data,
    Design: I  got a Workbook with several tabs, each tab has a input ready Query and has a layout as below
    A formatted user facing worksheet containing; an area where the user enters their plan data with a BEx save data button, an input ready query and a worksheet containing the BExSetData formulas that reference the values entered on the user facing worksheet.
    Issue: When i try to enter the value in the user facing sheet, the data is shown in the BexSet Data Sheet with out any problem,
    But when i try to save the data the data is not saved into the cube.
    Can any one please give some ideas of possible cause.
    One more question is the input ready query doesn't have any references to other sheets, will this be a reason for the data not saved?
    Please through some ideas.
    Thanks
    GC

    Hello,
    I think it is problem with the buffer:
    Check the notes 1136163, 1138864, 1146957, 1179076.
    please check the below;
    Delta buffer query in RSRT for BI-IP ("<infoprovider>/!!1<infoprovider>)
    Planning query donu2019t show the current data
    Thanks.
    With regards,
    Anand Kumar

  • Updating array data in sql database

    HI,
    Im facing problems in updating array data in SQL database.
    As of now, i am able to write an "insert" query and insert array data in an image datatype field. Im using image datatype because the array size is very big(around 80,000 x and y values).
    Althoug inserting data is easy im unable to write a query to update this data.
    Referring to the help of SQL server and Labview database connectivity toolkit, i came across a method of accessing image datatype....using textpointers, which are 16 bit binary values and using the WRITETEXT function instead of the UPDATE function.
    but the problem im facing is that ive to pass the array as a 2d string array in the query as a result the updated array is retrieved in the form of a string a
    nd not as an array. how do I get over this problem?

    Hi Pavitra,
    I'm not very clear on how you have inserted the data into your application, but I do know that when you call the UPDATETEXT or WRITETEXT function you use the TEXTPOINTERS to point to the first location of a 1d array. So, depending on how you've stored the data, you may have problems updating your data if you're looking at it as a 1d array instead of how you originally formatted it. If you are able to successfully access the data as a 1d array, you can use the database variant to data type vi and pass in a string array constant for the data type. This will convert the variant datatype into whatever you specify. You may have to index the row and column of the variant (you receive a 2d array of variant) first before you convert. If possible, can yo
    u provide some more detail and maybe some example code of how you perform the insert and plan to do the update? I can probably give you a better solution if I know how you are formatting the data. Thanks!
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments

  • How to stored data after clicking checkbox save in data base table

    REPORT  zreport                                 .
    TABLES:mseg,mard,mkpf.
    TYPE-POOLS:slis.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    DATA:BEGIN OF itab OCCURS 0,
         mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
         END OF itab.
    DATA:  gt_fieldcat TYPE slis_t_fieldcat_alv,
           gw_fieldcat TYPE slis_fieldcat_alv,
           gt_layout TYPE slis_layout_alv.
    START-OF-SELECTION.
    SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
    INTO TABLE itab FROM
              mseg JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
      IF sy-subrc EQ 0.
        SORT itab BY matnr.
        PERFORM display_alv_output.
      ENDIF.
    *&      Form  display_alv_output
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_output.
      REFRESH gt_fieldcat.
      gw_fieldcat-fieldname = 'MBLNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 1.
      gw_fieldcat-seltext_m = 'material document'.
      gw_fieldcat-key = 'x'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MATNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 2.
      gw_fieldcat-seltext_m = 'material'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'WERKS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 3.
      gw_fieldcat-seltext_m = 'plant'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGORT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 4.
      gw_fieldcat-seltext_m = 'storage location'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGPBE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 5.
      gw_fieldcat-seltext_m = 'storage bin'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'CHARG'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 6.
      gw_fieldcat-seltext_m = 'Batch number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BWART'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 7.
      gw_fieldcat-seltext_m = 'Movement Type (Inventory Management)'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BUDAT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 8.
      gw_fieldcat-seltext_m = 'Posting Date in the Document'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MENGE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 9.
      gw_fieldcat-seltext_m = 'QUANTITY'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MEINS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 10.
      gw_fieldcat-seltext_m = 'Basic unit of measure'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'KOSTL'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 11.
      gw_fieldcat-seltext_m = 'Cost center'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'AUFNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 12.
      gw_fieldcat-seltext_m = 'Order Number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'RSNUM'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 13.
      gw_fieldcat-seltext_m = 'Number of Reservation / Depe'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-col_pos = 14.
      gw_fieldcat-fieldname = 'CHECKBOX'.
      gw_fieldcat-seltext_m = 'Compltd'.
      gw_fieldcat-checkbox = 'X'.
      gw_fieldcat-edit = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = 'ZREPORT'
        I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IS_LAYOUT                         = gt_layout
        IT_FIELDCAT                       = gt_fieldcat
       TABLES
         t_outtab                          = itab
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2.
    ENDFORM.                    " display_alv_output
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
    P_SELFLD TYPE SLIS_SELFIELD.
    set pf-stATUS 'YSTATUS'.
    case p_ucomm.
    when 'SAVE'.
    Data ref1 type ref to cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = ref1.
    call method ref1->check_changed_data.
    Here you wil have the table with updated data
    itab2[] = itab[].
    delete itab where checkbox = space. "Mark is the field for the checkbox
    modify ztable from table itab.
    endcase.
    ENDFORM.
    use loop dump error is came.
    another solutions plz send me
    this is mycode.

    Hi Lakshmi,
    You please give me some more information related to your problem instead of pasting the total code here
    Warm Regards,
    Vijay

  • How tostored data  after clicking checkbox save in data base table

    REPORT  zreport                                 .
    TABLES:mseg,mard,mkpf.
    TYPE-POOLS:slis.
    DATA:BEGIN OF itab OCCURS 0,
         mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
         END OF itab.
    data: itab2 like standard table of ztable with header line.
    DATA:  gt_fieldcat TYPE slis_t_fieldcat_alv,
           gw_fieldcat TYPE slis_fieldcat_alv,
           gt_layout TYPE slis_layout_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    START-OF-SELECTION.
    SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
    INTO TABLE itab FROM
              mseg JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
      IF sy-subrc EQ 0.
        SORT itab BY matnr.
        PERFORM display_alv_output.
      ENDIF.
    *&      Form  display_alv_output
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_output.
      REFRESH gt_fieldcat.
      gw_fieldcat-fieldname = 'MBLNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 1.
      gw_fieldcat-seltext_m = 'material document'.
      gw_fieldcat-key = 'x'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MATNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 2.
      gw_fieldcat-seltext_m = 'material'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'WERKS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 3.
      gw_fieldcat-seltext_m = 'plant'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGORT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 4.
      gw_fieldcat-seltext_m = 'storage location'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGPBE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 5.
      gw_fieldcat-seltext_m = 'storage bin'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'CHARG'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 6.
      gw_fieldcat-seltext_m = 'Batch number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BWART'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 7.
      gw_fieldcat-seltext_m = 'Movement Type (Inventory Management)'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BUDAT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 8.
      gw_fieldcat-seltext_m = 'Posting Date in the Document'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MENGE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 9.
      gw_fieldcat-seltext_m = 'QUANTITY'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MEINS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 10.
      gw_fieldcat-seltext_m = 'Basic unit of measure'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'KOSTL'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 11.
      gw_fieldcat-seltext_m = 'Cost center'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'AUFNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 12.
      gw_fieldcat-seltext_m = 'Order Number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'RSNUM'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 13.
      gw_fieldcat-seltext_m = 'Number of Reservation / Depe'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-col_pos = 14.
      gw_fieldcat-fieldname = 'CHECKBOX'.
      gw_fieldcat-seltext_m = 'Compltd'.
      gw_fieldcat-checkbox = 'X'.
      gw_fieldcat-edit = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = 'ZREPORT'
       I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IS_LAYOUT                         = gt_layout
        IT_FIELDCAT                       = gt_fieldcat
       TABLES
         t_outtab                          = itab
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2.
    ENDFORM.                    " display_alv_output
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
    P_SELFLD TYPE SLIS_SELFIELD.
    *set pf-stATUS 'YSTATUS'.
    case p_ucomm.
    when 'SAVE'.
    Data ref1 type ref to cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = ref1.
    call method ref1->check_changed_data.
    *itab2[] = itab[].
    delete itab where checkbox = space. "Mark is the field for the checkbox
    modify ztable from table itab2.
    endcase.
    ENDFORM.
    this is my cde error is  not came,
    plz check that one,send me reply

    REPORT  YH648_1111111.
    TABLES SSCRFIELDS.
    parameter : c  AS CHECKBOX USER-COMMAND SUNIL
    AT SELECTION-SCREEN .
    SY-UCOMM = SSCRFIELDS-UCOMM.
    START-OF-SELECTION.
      CASE SY-UCOMM.
        WHEN 'SUNIL'.
          WRITE 'SUNIL KUMAR .BETHINEDI'.
        WHEN ' '.
          WRITE 'BLA BLA BLA '.
    ENDCASE.
    THIS IS THE WAY U CAN USE THE CHECK BOX.
    INSTED OF THIS  WRITE 'SUNIL KUMAR .BETHINEDI'.
    U USE THE INSERT STATEMENT.

  • How to send Array data using Post Method?

    Var array = $_POST['myData'];
    array[0] => 'ABC'
    array[1] => 'DEF'
    how to improve this code to support send array data...?
    String url ="http://xxxxx/test.php";
    String[] arraystr={"ABC", "DEF", "EDFF"}
    String parameter = "myData=" +arraystr;    // no support this
    Strint str = postMrthod(url, parameter );
    public static String postMethod(String url, String parameter) {
            StringBuffer b = new StringBuffer("");
            HttpConnection hc = null;
            InputStream in = null;
            OutputStream out = null;
            try {
                hc = (HttpConnection) Connector.open(url);
                hc.setRequestMethod(HttpConnection.POST);
                hc.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
                hc.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
                out = hc.openOutputStream();
                byte postmsg[] = parameter.getBytes();
                for (int i = 0; i < postmsg.length; i++) {
                    out.write(postmsg);
    out.flush();
    in = hc.openInputStream();
    int ch;
    while ((ch = in.read()) != -1) {
    b.append((char) ch);
    } catch (IOException e) {
    e.printStackTrace();
    try {
    if (in != null) {
    in.close();
    if (hc != null) {
    hc.close();
    } catch (IOException e) {
    e.printStackTrace();
    return b.toString().trim();

    yes, you can send integer value like this. But I think you have to put quotes around <%= TAMID%> i.e.
    <input type="hidden" id="HTTP_CVHTAMID"
    name="HTTP_CVHTAMID" value= "<%= TAMID%>" >

Maybe you are looking for