Adding rows in existing table

Hi gurus,
Please tell me how to add  row to the existing table where we enter conditions while defining the calculation schema.
i.e. Control data screen for calculation schema.

Hi Diwakar,
Two ways of creating the 3 static rows intially is either create 3 rows manually Or create a single row in table and then in Binding check the check box "Repeat Row for each Item Data" and set min count to "1" and initial count to "3"
and in add button use the same code as you are using with addInstance(1)
Or try this below:
TableSubform.Item_Table.Row1.instanceManager.addInstance(1);
Sachin

Similar Messages

  • How to see Added Row in a table

    Hi
    i have taken atable with visible row count 5 and ihave taken a button to add new row for that i have written code in action of that button,when ever a new row is added  that added row below the 5th row, to see that added row ishould click on UP button of table,*what i want i as soon as new row added 1st row of table should go up and remaing 5 rows should appear(2,3,4,5,6 rows)  ,suppose if i click on add row 2nd row should go up and remaingrows should appear(3,4,5,6 rows).please help me out of this problem
    Thanks
    Kishore

    Hi Kishore,
    Try this.
    public void onActionAddRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionAddRow(ServerEvent)
        int row = wdContext.nodeCustomer().size();
        IPrivateTestCompView.ICustomerElement custElm = wdContext.createCustomerElement();
         custElm.setCname("");
         custElm.setCno("");
         custElm.setCsal("");
         wdContext.nodeCustomer().addElement(custElm);
         //for swap the rows
         for(int i=1;i<=row;i++)
              wdContext.nodeCustomer().swapElements( 0, i );     
        //@@end
    Regards,
    Mithu

  • Reading the Data from dynamically added rows of a table...

    Hi,
                  I am using adobe interactive form (WD ABAP) in which i am adding the table rows dynamically (using Jscript code).  I have to fech these data into an internal table. But I can read only the first row data..
                  Also While adding rows dynamically the same data is repeating for the consecutive rows..
                  I have found many similar posts in sdn, but i cannot get the solution. They have mentioned about adding in WDDOINIT method. Can anyone explain me what should be done,..?
    1) How to solve repeatative data while adding rows..?
    2) How to read dynamically added row data during runtime into internal table..?
    Thanks,
    Surya.

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Problem in adding rows in a table

    Hello All ,
    I am having a strange problem in adding table rows here . All things seems to be in place . But when i click the button nothing happens . I have worked on much more complex tables and added rows safely but i cant understand what's happening here . I have saved the form as Dynamic XML form , interactive form , I have set the pagination of the repeating rows . But Heck !!! It's not working at all . I am totally confused . More over while i drag the table from the object palette an error appears and LC closes down .But when i click on the table at the toolbar and inserted table over there then it shows no error . What's happening ?? Any help is greatly appreciated .
    Script : form1.Page1.Subform1.Button1::click - (JavaScript, client)
    form1.Page1.Subform1.Table1.Row4.instanceManager.addInstance(1);
    Thanks .
    Bibhu.

    Hi,
    The way you described reminded me of another thread, where the index was not straightforward: Saving finished Form duplicates some subForms
    You can post your form to Acrobat.com, hit the Share and Publish buttons when prompted and then copy / paste the link here.
    Niall

  • Adding row to a table in adobe forms

    Hi Experts,
    I have requirement in my form.
    where i will be adding a row to a table when ever user clicks on the add row button.
    pleae let me know how can i achieve this.
    Thanks,
    Santosh

    https://wiki.sdn.sap.com/wiki/display/ABAP/AdobeFormsfrom+Scratch

  • Adding rows to a table

    Hi All,
    My application has few JSP pages , one of the JSP page generates HTML table with textboxes & hyperlinks(in table cells) populated with data pulled from the database. I have an "Add" button to add new empty rows. Add I'm performing via DOM. And this works well. But when I click the hyperlink go to another jsp page get data and return to first page(page with table) page all changes(added rows ) are disappeared....
    How do I solve this................ Thanks in advance.

    one thing to solve this is to put a variable(# of rows that you added) into session, hidden element, or db as record.. then if you go to the next page and go back to the previous page.. you will request for the variable(# of rows that you added) then you will use it in your loop in javascript to call the function that adds the rows

  • Adding row into existing CSV file using C#

    How to add row to existing CSV file using .NET Code.the file should not be overwrite,it need add another row with data.how to implement this scenario.

    Hi BizQ,
    If you only just write some data to CSV file. Please follow A.Zaied and Magnus  's reply. In general,we use CSV file to import or export some data. Like following thread and a good article in codeproject
    Convert a CSV file to Excel using C#
    Writing a DataTable to a CSV file
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Adding row at a table in indesign CS6 from javascript

    I have a table in my indesign page.It has one column and several rows. I want to add a row at the begining of the table  and add some text content to it.
    I tried some provided code but none have worked.
    This is how i reference the table object.
    var mytable =myPage.textFrames.item(0).tables.item(0);
    I tried each the following but none worked and gave an error
       mytable.rows[0].cells[0].insertionPoints[0].contents =  "TEST TEST";
       mytable.rows.add( LocationOptions.AFTER, mytable.rows[-1] );
       mytable.rows.add( LocationOptions.Before, mytable.rows[0] );
    What should i do?

    I am actually looping over every page in my indesign file, every page contains 1 textframe with text inside it. I add a new textframe to the page and then move the new textframe content into the begginning of the existing textframe then delete the created one
    myPage = myDocument.pages.item(x);
    myTextFrame = myPage.textFrames.item(0);
    newframe = myPage.textFrames.add();
    newframe.contents ="TEST TEST" ;
    newframe.paragraphs[0].appliedFont = app.fonts.item("Times New Roman");
    newframe.paragraphs[0].fontStyle = "Bold";
                                                newframe.parentStory.paragraphs.item(0).words.item(0).move(LocationOptions.AT_BEGINNING,m yTextFrame);
    newframe.remove();
    This was working correctly on all files until i faced one with a table. The code stoppes at this line
    newframe.parentStory.paragraphs.item(0).words.item(0).move(LocationOptions.AT_BEGINNING,my TextFrame);
    and Indesign becomes Not Responding
    The table is visually inside the page textframe. I need to do the same logic when having a table i couldnt call the move function when the page has a table and not text in its textframe. I thought abt accessing the table in the page and adding a row at the beginning then writing in it what i need, alternative to what am doing with normal text instead of creating new frame and then moving text to original textframe at beginning.
    When my textframe.content="" i know that there is a table and i need to alter it. Otherwise i do add new frame ,move content then delete.
    Any suggestions?

  • Adding rows to new table.

    Hi,
    i was wondering if it is possible to Intially start with one row in a jtable and add rows( one by one) when one of the colums in the column get focus or something like that ...
    can someone help me with this one...
    thanks.

    Define interface MutableTableModel and implement it.
    * @(#)MutableTableModel.java
    * All Rights Reserved.
    * This software is the proprietary information of
    * Use is subject to license terms.
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.TableModel;
    import java.util.Vector;
    public interface MutableTableModel extends TableModel
         public static final String UNDO_ACTION="Undo";
         public static final String REDO_ACTION="Redo";
         public static final String APPLY_ACTION="Apply";
         public static final String CONFIRM_ACTION="OK";
         public static final String DISCARD_ACTION="Restore";
    * Returns the number of rows in the model. A
    * <code>JTable</code> uses this method to determine how many rows it
    * should display. This method should be quick, as it
    * is called frequently during rendering.
    * @return the number of rows in the model
    * @see #getColumnCount
    public int getRowCount();
    * Returns the number of columns in the model. A
    * <code>JTable</code> uses this method to determine how many columns it
    * should create and display by default.
    * @return the number of columns in the model
    * @see #getRowCount
    public int getColumnCount();
    * Returns the name of the column at <code>columnIndex</code>. This is used
    * to initialize the table's column header name. Note: this name does
    * not need to be unique; two columns in a table can have the same name.
    * @param     columnIndex     the index of the column
    * @return the name of the column
    public String getColumnName(int columnIndex);
    * Returns the most specific superclass for all the cell values
    * in the column. This is used by the <code>JTable</code> to set up a
    * default renderer and editor for the column.
    * @param columnIndex the index of the column
    * @return the common ancestor class of the object values in the model.
    public Class getColumnClass(int columnIndex);
    * Returns true if the cell at <code>rowIndex</code> and
    * <code>columnIndex</code>
    * is editable. Otherwise, <code>setValueAt</code> on the cell will not
    * change the value of that cell.
    * @param     rowIndex     the row whose value to be queried
    * @param     columnIndex     the column whose value to be queried
    * @return     true if the cell is editable
    * @see #setValueAt
    public boolean isCellEditable(int rowIndex, int columnIndex);
    * Returns the value for the cell at <code>columnIndex</code> and
    * <code>rowIndex</code>.
    * @param     rowIndex     the row whose value is to be queried
    * @param     columnIndex      the column whose value is to be queried
    * @return     the value Object at the specified cell
    public Object getValueAt(int rowIndex, int columnIndex);
    * Sets the value in the cell at <code>columnIndex</code> and
    * <code>rowIndex</code> to <code>aValue</code>.
    * @param     aValue          the new value
    * @param     rowIndex     the row whose value is to be changed
    * @param     columnIndex      the column whose value is to be changed
    * @see #getValueAt
    * @see #isCellEditable
    public void setValueAt(Object aValue, int rowIndex, int columnIndex);
    * Adds a listener to the list that is notified each time a change
    * to the data model occurs.
    * @param     l          the TableModelListener
    public void addTableModelListener(TableModelListener l);
    * Removes a listener from the list that is notified each time a
    * change to the data model occurs.
    * @param     l          the TableModelListener
    public void removeTableModelListener(TableModelListener l);
    * Ensures that the new rows have the correct number of columns.
    * This is accomplished by using the <code>setSize</code> method in
    * <code>Vector</code> which truncates vectors
    * which are too long, and appends <code>null</code>s if they
    * are too short.
    * This method also sends out a <code>tableChanged</code>
    * notification message to all the listeners.
    * @param event this <code>TableModelEvent</code> describes
    * where the rows were added.
    *                    If <code>null</code> it assumes
    * all the rows were newly added
    * @see #getDataVector
    public void newRowsAdded(TableModelEvent event);
    * Equivalent to <code>fireTableChanged</code>.
    * @param event the change event
    public void rowsRemoved(TableModelEvent event);
    * Replaces the column identifiers in the model. If the number of
    * <code>newIdentifier</code>s is greater than the current number
    * of columns, new columns are added to the end of each row in the model.
    * If the number of <code>newIdentifier</code>s is less than the current
    * number of columns, all the extra columns at the end of a row are
    * discarded. <p>
    * @param newIdentifiers vector of column identifiers. If
    *                    <code>null</code>, set the model
    * to zero columns
    * @see #setNumRows
    public void setColumnIdentifiers(Vector newIdentifiers);
    * Replaces the column identifiers in the model. If the number of
    * <code>newIdentifier</code>s is greater than the current number
    * of columns, new columns are added to the end of each row in the model.
    * If the number of <code>newIdentifier</code>s is less than the current
    * number of columns, all the extra columns at the end of a row are
    * discarded. <p>
    * @param newIdentifiers array of column identifiers.
    *                    If <code>null</code>, set
    * the model to zero columns
    * @see #setNumRows
    public void setColumnIdentifiers(Object[] newIdentifiers);
    * Sets the number of rows in the model. If the new size is greater
    * than the current size, new rows are added to the end of the model
    * If the new size is less than the current size, all
    * rows at index <code>rowCount</code> and greater are discarded. <p>
    * @see #setColumnCount
    public void setRowCount(int rowCount);
    * Sets the number of columns in the model. If the new size is greater
    * than the current size, new columns are added to the end of the model
    * with <code>null</code> cell values.
    * If the new size is less than the current size, all columns at index
    * <code>columnCount</code> and greater are discarded.
    * @param columnCount the new number of columns in the model
    * @see #setColumnCount
    public void setColumnCount(int columnCount);
    * Adds a column to the model. The new column will have the
    * identifier <code>columnName</code>. This method will send a
    * <code>tableChanged</code> notification message to all the listeners.
    * This method is a cover for <code>addColumn(Object, Vector)</code> which
    * uses <code>null</code> as the data vector.
    * @param columnName the identifier of the column being added
    * @exception IllegalArgumentException if <code>columnName</code>
    *                              is <code>null</code>
    public void addColumn(Object columnName);
    * Adds a column to the model. The new column will have the
    * identifier <code>columnName</code>. <code>columnData</code> is the
    * optional vector of data for the column. If it is <code>null</code>
    * the column is filled with <code>null</code> values. Otherwise,
    * the new data will be added to model starting with the first
    * element going to row 0, etc. This method will send a
    * <code>tableChanged</code> notification message to all the listeners.
    * @param columnName the identifier of the column being added
    * @param columnData optional data of the column being added
    * @exception IllegalArgumentException if <code>columnName</code>
    *                              is <code>null</code>
    public void addColumn(Object columnName, Vector columnData);
    * Adds a column to the model. The new column will have the
    * identifier <code>columnName</code>. <code>columnData</code> is the
    * optional array of data for the column. If it is <code>null</code>
    * the column is filled with <code>null</code> values. Otherwise,
    * the new data will be added to model starting with the first
    * element going to row 0, etc. This method will send a
    * <code>tableChanged</code> notification message to all the listeners.
    * @see #addColumn(Object, Vector)
    public void addColumn(Object columnName, Object[] columnData);
    * Adds a row to the end of the model. The new row will contain
    * <code>null</code> values unless <code>rowData</code> is specified.
    * Notification of the row being added will be generated.
    * @param rowData optional data of the row being added
    public void addRow(Vector rowData);
    * Adds a row to the end of the model. The new row will contain
    * <code>null</code> values unless <code>rowData</code> is specified.
    * Notification of the row being added will be generated.
    * @param rowData optional data of the row being added
    public void addRow(Object[] rowData);
    * Inserts a row at <code>row</code> in the model. The new row
    * will contain <code>null</code> values unless <code>rowData</code>
    * is specified. Notification of the row being added will be generated.
    * @param row the row index of the row to be inserted
    * @param rowData optional data of the row being added
    * @exception ArrayIndexOutOfBoundsException if the row was invalid
    public void insertRow(int row, Vector rowData);
    * Inserts a row at <code>row</code> in the model. The new row
    * will contain <code>null</code> values unless <code>rowData</code>
    * is specified. Notification of the row being added will be generated.
    * @param row the row index of the row to be inserted
    * @param rowData optional data of the row being added
    * @exception ArrayIndexOutOfBoundsException if the row was invalid
    public void insertRow(int row, Object[] rowData);
    * Moves one or more rows starting at <code>startIndex</code>
    * to <code>endIndex</code> in the model to the <code>toIndex</code>.
    * This method will send a <code>tableChanged</code> notification
    * message to all the listeners. <p>
    * <pre>
    * Examples of moves:<p>
    * 1. moveRow(1,3,5);<p>
    * a|B|C|D|e|f|g|h|i|j|k - before
    * a|e|f|B|C|D|g|h|i|j|k - after<p>
    * 2. moveRow(6,7,1);<p>
    * a|b|c|d|e|f|G|H|i|j|k - before
    * a|G|H|b|c|d|e|f|i|j|k - after
    * </pre>
    * @param startIndex the starting row index to be moved
    * @param endIndex the ending row index to be moved
    * @param toIndex the destination of the rows to be moved
    * @exception ArrayIndexOutOfBoundsException if any of the indices
    * are out of range; or if <code>endIndex</code>
    *                    is less than <code>startIndex</code>
    public void moveRow(int startIndex, int endIndex, int toIndex);
    * Removes the row at <code>row</code> from the model. Notification
    * of the row being removed will be sent to all the listeners.
    * @param row the row index of the row to be removed
    * @exception ArrayIndexOutOfBoundsException if the row was invalid
    public void removeRow(int row) ;
    * Inserts a column at <code>column</code> in the model. The new column
    * will contain <code>null</code> values unless <code>columnData</code>
    * is specified. Notification of the column being added will be generated.
    * @param column the column index of the column to be inserted
    * @param columnData optional data of the column being added
    * @exception ArrayIndexOutOfBoundsException if the column was invalid
    public void insertColumn(int column, Object columnName, Vector columnData);
    * Inserts a column at <code>column</code> in the model. The new column
    * will contain <code>null</code> values unless <code>columnData</code>
    * is specified. Notification of the column being added will be generated.
    * @param column the column index of the column to be inserted
    * @param columnData optional data of the column being added
    * @exception ArrayIndexOutOfBoundsException if the column was invalid
    public void insertColumn(int column, Object columnName, Object[] columnData);
    * Moves one or more columns starting at <code>startIndex</code>
    * to <code>endIndex</code> in the model to the <code>toIndex</code>.
    * This method will send a <code>tableChanged</code> notification
    * message to all the listeners. <p>
    * @param startIndex the starting column index to be moved
    * @param endIndex the ending column index to be moved
    * @param toIndex the destination of the columns to be moved
    * @exception ArrayIndexOutOfBoundsException if any of the indices
    * are out of range; or if <code>endIndex</code>
    *                                   is less than <code>startIndex</code>
    public void moveColumn(int startIndex, int endIndex, int toIndex);
    * Removes the column at <code>column</code> from the model. Notification
    * of the column being removed will be sent to all the listeners.
    * @param column the column index of the column to be removed
    * @exception ArrayIndexOutOfBoundsException if the column was invalid
    public void removeColumn(int column);
    * Removes the column with the <code>columnName</code> from the model. Notification
    * of the column being removed will be sent to all the listeners.
    * @param columnName the name of the column to be removed
    * @exception ArrayIndexOutOfBoundsException if the column could not be found
    public void removeColumn(Object columnName);
         * if the model supports undo
    public boolean supportUndo();
    * undo the last change
    public void undo();
    * redo
    public void redo();
    * check if can undo
    public boolean canUndo();
    * check if can redo
    public boolean canRedo();
         * return an array of actions supported by this model
    public Action[] actions();
    * returns the Action with the given name supported by this model
    public Action getAction(String name);

  • How to view added rows in table; there is a horizontal line below which any added rows disppear!  Pages version 5.1 which I DESPISE!!!!

    I just replaced Pages after paying Apple $400+ for replacing a wiped-out hard-drive....
    MANY HORRIBLE QUIRKS with Pages 5.1...
    the one I listed above.....it's as if there is only one page....I can't see any added rows in the table below this arbitrary line drawn across the bottom!  I can ADD the rows, but nothing I type in them is visible!

    Do you have Pages '09 in your Applications/iWork folder?
    If not ask Apple to give it to you again.
    You own it.
    Peter

  • Adobe form from webdynpro : Getting a single row in the table

    Hello,
    I have a scenario in which I have to create a adobeform from webdynpro application.
    I have created the form and have the context designed in place.
    I am facing a problem in the table I have in my adobeform.
    I am adding rows to this table dynamically using a button using "addInstance"
    Now on the webdynpro side , when I try to read this table I get a single row from this table.
    This row is always the first row of that table.
    I checked the following things from blog   /people/juergen.hauser2/blog/2006/09/12/avoiding-common-mistakes-when-using-tables-on-sap-interactive-forms  , i.e. :
    Cardinality of the node.
    Tick on the option "Repeat Row for Each Data Item".
    But still no success.
    With deadlines to catch I had to post this question after trying a lot.Please help.

    Hello Otto,
    I had found this link before and used the same solution , but unfortunately is taking a long time.
    Now what I am doing is :
    1. I append 10 rows into the table then bind it to the node
    2. Then on the adobe form I have removed the check on "Add row for each line item" because of which it shows only 1 row 
         on the form.
         Now I add rows dynamically, but this puts a limit on the number of rows can be added to the table i.e. 10.
    But this again has added problems like while displaying the form or modifying I hav to handle it seperately and cannot use the same form as it is.( as I have removed the tick for "Add row for each line item" ).
    Thanks,
    Omkar Mirvankar

  • Add null rows in WDDOINIT  for fetching data from dynamically added rows..

    Hi,,
    I have to fetch data from a dynamically added rows of a table.
    I have followed / gone through many forums but they ddnot mention how to add null rows in the initialization method..
    I am using WD Abap..
    Can anyone help how to bind null rows in WDDOINIT method..?
    Thanks,
    Surya

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Adding rows onto a new page in a table

    Hi,
    I have created a form that had the last page as a subform with a table on it, flowed western so that the cells expand with content./ Also added a add new row button to it (as per the scripting given in the Livecycle help), all of which was working fine. I then moved the subform with the table to the middle of my document instead of the last page and now when I add rows, it doesn't create a new page when it reaches the end, but just continues down off the end of the existing page. The following pages are just information set it their own sub forms.. do I need to change the subform pagination or hte scripting or the table settings to make it add an extra page and keep adding rows in the middle of the form?
    Many thanks for any assistance
    Jackie

    No the issue is with the page subform ...it must be flowed as well .....make sure you wrap all of the other content in Positioned subforms or it will be flowed also.
    Paul

  • New rows in Adobe table are not added to WD Context

    Hi experts: we have several Adobe Interactive forms.  Each has a table.  the user can add rows to the table, but when they do, the WD ABAP context does not get additional rows added to it. The new rows appear on the form, but not in the context.   If users change values in existing table rows, those values are changed in the context; however, new rows do not show up in context.
    Our Hierarchy Layout:
    P1
    --TableSub
    InnerSub
    Table1
    Row1
    <table fields>
    Remove (button)
    Add (button)
    The JavaScript for the buttons: ADD button...
    P1.TableSub.InnerSub.Add::click - (JavaScript, client)
    this.parent.instanceManager.addInstance();  // this adds a row, context not changed...
    xfa.form.recalculate();
    Remove button:
    P1.TableSub.InnerSub.Remove::click - (JavaScript, client)
    P1.TableSub.InnerSub.instanceManager.removeInstance(this.parent.index);  // this keeps same # of context rows, but  "removed
                                                                      // rows" have data replaced by duplicate data of another row; can deal with this issue...
    xfa.form.recalculate();
    The WD Context node has Cardinality 0..n  Selection: 0..n  (have tried 0..1, too).  No difference in context with additional form rows.
    Anybody, any ideas as to why # of rows in WD Context is not being altered by the Interactive Form?  Thanks!
    Edited by: Jack Hofmann on Aug 2, 2010 11:25 PM

    Hello,
    This question is asked many times in this forum.
    These links might help you:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/802f0ed1-a17a-2c10-7db4-d515a5b047ed
    Re: Table control in Adobe forms
    Adobe form from webdynpro : Getting a single row in the table
    Thanks & Regards,
    Omkar Mirvankar.

  • Adding 2 more rows to a select without inserting rows to base table

    hello all,
    i have a below simple select statement which is querying a table.
    select * from STUDY_SCHED_INTERVAL_TEMP
    where STUDY_KEY = 1063;
    but here is the situations. As you can see its returning 7 rows. But i need to add
    2 more rows..with everything else default value or what exist... except adding 2 more rows.
    i cannot insert into base table. I want my end results to increment by 2 days in
    measurement_date_Taken to 01-apr-09....so basically measurement_date_taken should
    end at study_end_Date...
    IS THAT EVEN POSSIBLE WITHOUT INSERTING ROWS INTO THE TABLE AND JUST PLAYIHY AROUND WITH
    THE SELECT STATEMENT??
    sorry if this is confusing...i am on 10.2.0.3
    Edited by: S2K on Aug 13, 2009 2:19 PM

    Well, I'm not sure if this query looks as good as my lawn, but seems to work anyway ;)
    I've used the 'simplified version', but the principle should work for your table to, S2K.
    As Frank already pointed out (and I stumbled upon it while clunging): you just select your already existing rows and union them with the 'missing records', you calculate the number of days you're 'missing' based on the study_end_date:
    MHO%xe> alter session set nls_date_language='AMERICAN';
    Sessie is gewijzigd.
    Verstreken: 00:00:00.01
    MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn
      2  select 1063 study_key
      3  ,      to_date('01-MAR-09', 'dd-mon-rr') phase_start_date
      4  ,      to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken
      5  ,      to_date('01-APR-09', 'dd-mon-rr') study_end_date
      6  from dual union all
      7  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      8  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      9  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
    10  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
    11  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
    12  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual
    13  ) -- actual query:
    14  select study_key
    15  ,      phase_start_date
    16  ,      measurement_date_taken
    17  ,      study_end_date
    18  from   t
    19  union all
    20  select study_key
    21  ,      phase_start_date
    22  ,      measurement_date_taken + level -- or rownum
    23  ,      study_end_date
    24  from ( select study_key
    25         ,      phase_start_date
    26         ,      measurement_date_taken
    27         ,      study_end_date
    28         ,      add_up
    29         from (
    30                select study_key
    31                ,      phase_start_date
    32                ,      measurement_date_taken
    33                ,      study_end_date
    34                ,      study_end_date - max(measurement_date_taken) over (partition by study_key
    35                                                                          order by measurement_date_taken ) add_up
    36                ,      lead(measurement_date_taken) over (partition by study_key
    37                                                          order by measurement_date_taken ) last_rec
    38                from   t
    39              )
    40         where last_rec is null
    41       )
    42  where rownum <= add_up
    43  connect by level <= add_up;
    STUDY_KEY PHASE_START_DATE    MEASUREMENT_DATE_TA STUDY_END_DATE
          1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00
    9 rijen zijn geselecteerd.If there's a simpler way (in SQL), I hope others will join and share their example/ideas/thoughts.
    I have a feeling that this is using more resources than needed.
    But I've got to cut the daisies first now, they interfere my 'lawn-green-ess' ;)

Maybe you are looking for

  • Index: The argument is out of range: 8 0 or 8 =8. (Error: RWI 00012)

    Hi Friends, One of my user is receiving the below error, pls help me is resolving this. index: The argument is out of range: 8<0 or 8>=8. (Error: RWI 00012) Thanks in Advance MMVIHAR

  • Discoverer 3.1 User Guide

    Is there anywhere on the net where I can still download Discoverer 3.1 documentation, especially the User Guide? Thanks!

  • What happened to the nightly builds?

    I've noticed that as of late there have been no nightly builds on the  Flex 3 or 4 SDK. This is odd to me, simply because these used to get  published on a relatively regular basis. However, there hasn't been a  nightly build of the Flex 4 SDK since

  • Relay Host for Outbound Messages not being used...

    I have a new v7 GWIA on a new domain that is using the relay settings from the original GWIA (on a separate domain) despite its own settings. Anyone seen this before? Regards

  • Image Processor freezes, ignore video files?

    I am trying to use the Image Processor to create a copy of my photo directory but sized much smaller and lower quality. Like a super shrunk backup, basically. It is doing exactly what I want, but it keeps freezing regularly. It will do a few dozen ph