Dynamic rows for dynamic data

Hi,
Can i have a JTable in which i create number of rows depending on the data i retreive frm the database, and also increase the number of rows on some kind of event.
For example:
I have to enter into a JTable names of students who are being admitted to a school, i have a specific format in the UI with fields(columns) like Name, Age, Sex. I give them a 5 rows as default. As the user comes to the 5th and 5th cell, tht is last cell of the table, as soon as the user presses Enter key another row/s should appear. And also if i am retreiving frm the database, depending on a query like give me names of students who are all females, then i dont know the number of rows required, therefore deciding dynamically or on-the-fly the number of rows required.
Please if you can help me, tht will be great.
Thank You.
Ehsaan
p.s-If u need more information pls do write.

Here's an example of a model you may want to use. It allows you to add or subtract rows, as needed. It starts with 0 rows - in this case.
You need to define another class TableRecord, which basically is contains the data to insert into a row.
Hope this helps.
public class FileModel extends AbstractTableModel
public boolean isEditable = false;
protected static int NUM_COLUMNS = 3;
// initialize number of rows to start out with ...
protected static int START_NUM_ROWS = 0;
protected int nextEmptyRow = 0;
protected int numRows = 0;
static final public String first= "First";
static final public String second= "Second";
static final public String third= "Third";
static final public String columnNames[] = {"FIrst", "Second", "Third"};
// List of data
protected Vector data = null;
public FileModel()
data = new Vector();
public boolean isCellEditable(int rowIndex, int columnIndex)
// The 3rd column or Value field is editable
if(isEditable)
if(columnIndex > 1)
return true;
return false;
public Class getColumnClass(int c)
return getValueAt(0, c).getClass();
* Retrieves number of columns
public synchronized int getColumnCount()
return NUM_COLUMNS;
* Get a column name
public String getColumnName(int col)
return columnNames[col];
* Retrieves number of records
public synchronized int getRowCount()
if (numRows < START_NUM_ROWS)
return START_NUM_ROWS;
else
return numRows;
* Returns cell information of a record at location row,column
public synchronized Object getValueAt(int row, int column)
try
FileRecord p = (FileRecord)data.elementAt(row);
switch (column)
case 0:
return (String)p.first;
case 1:
return (String)p.second;
case 2:
return (String)p.third;
catch (Exception e)
return "";
public void setValueAt(Object aValue, int row, int column)
FileRecord arow = (FileRecord)data.elementAt(row);
arow.setElementAt((String)aValue, column);
fireTableCellUpdated(row, column);
* Returns information of an entire record at location row
public synchronized FileRecord getRecordAt(int row) throws Exception
try
return (FileRecord)data.elementAt(row);
catch (Exception e)
throw new Exception("Record not found");
* Used to add or update a record
* @param tableRecord
public synchronized void updateRecord(FileRecord tableRecord)
String file = tableRecord.file;
FileRecord p = null;
int index = -1;
boolean found = false;
boolean addedRow = false;
int i = 0;
while (!found && (i < nextEmptyRow))
p = (FileRecord)data.elementAt(i);
if (p.file.equals(file))
found = true;
index = i;
} else
i++;
if (found)
{ //update
data.setElementAt(tableRecord, index);
else
if (numRows <= nextEmptyRow)
//add a row
numRows++;
addedRow = true;
index = nextEmptyRow;
data.addElement(tableRecord);
//Notify listeners that the data changed.
if (addedRow)
nextEmptyRow++;
fireTableRowsInserted(index, index);
else
fireTableRowsUpdated(index, index);
* Used to delete a record
public synchronized void deleteRecord(String file)
FileRecord5 p = null;
int index = -1;
boolean found = false;
int i = 0;
while (!found && (i < nextEmptyRow))
p = (FileRecord5)data.elementAt(i);
if (p.file.equals(file))
found = true;
index = i;
} else
i++;
if (found)
data.removeElementAt(i);
nextEmptyRow--;
numRows--;
fireTableRowsDeleted(START_NUM_ROWS, numRows);
}

Similar Messages

  • Cannot read the next data row for the data set

    Hi,
    My report runs fine when I view in VS, data shows fine when I run the query in the data window, but when I publish it to the server, I get the above error. I am running SQL server 2005 RTM and I have re-deployed the entire solution.
    Any ideas?

    Hi All,
    Upon investigation found that there was an issue with converting varchar value to datatime datatype in Stored Procedure and that is why report was throwing error.
    I ran same report in BIDS and got clear error message
    An error has occurred during report processing. (rsProcessingAborted)
    Cannot read the next data row for the dataset xxx. (rsErrorReadingNextDataRow)
    The conversion of a varchar datatype to a datetime datatype resulted in an out-of-range value
    Once I corrected this, It is working fine.
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Get only the first row for duplicate data

    Hello,
    I have the following situation...
    I have a table called employees with column (re, name, function) where "re" is the primary key.
    I have to import data inside this table using an xml file, the problem is that some employees can be repeated inside this xml, that means, I'll have repeated "re"'s, and this columns is primary key of my table.
    To workaround, I've created a table called employees_tmp that has the same structed as employees, but without the constraint of primary key, on this way I can import the xml data inside the table employees_tmp.
    What I need now is copy the data from employees_tmp to employess, but for the cases where "re" is repeated, I just want to copy the first row found.
    Just an example:
    EMPLOYEES_TMP
    RE NAME FUNCTION
    0987 GABRIEL ANALYST
    0987 GABRIEL MANAGER
    0978 RANIERI ANALYST
    0875 RICHARD VICE-PRESIDENT
    I want to copy the data to make employees looks like
    EMPLOYEES
    RE NAME FUNCTION
    0987 GABRIEL ANALYST
    0978 RANIERI ANALYST
    0875 RICHARD VICE-PRESIDENT
    How could I do this?
    I really appreciate any help.
    Thanks

    Try,
    SELECT re, NAME, FUNCTION
      FROM (SELECT re,
                   NAME,
                   FUNCTION,
                   ROW_NUMBER () OVER (PARTITION BY re ORDER BY NAME) rn
              FROM employees_tmp)
    WHERE rn = 1G.

  • # row for Master data report

    Hi,
    I created a report on Master data object. I am seeing a line on this report with # filled in for key field as well. How to hide this line completely?
    Thanks,
    Dona

    Sudheer, thanks for the solution. But I would like to display my key object as well in the report. Also wouldn't exclusion be a hindrance to performace?
    is there any other solution not to display the # key value that is part of Master data architecture?

  • Query to return separate rows for date range including NULLs

    I'm trying to write a query that will return all customers from table 1. Table 1 also provides a start date and an end date that may be different for different customers. Left join with Table 2  provides all matches and NULL if NO matches.
    If there is any match at all, I do not get the NULLs for other dates. There should be a match for each date from start to end. How can I write the code so that my return will loop thru each date and provide the match or NULL?

    Sorry. I am somewhat new to this and am not sure what you are requesting. I receive a return of all customers with the code below but if customer 1 has a start date of 1/1/15 and a stop date of 1/5/15 and a document exists for 1/1/15 and 1/3/15
    I do not receive the rows with NUL for 1/2/15, 1/4/15, and 1/5/15 which is what I'm trying to accomplish. If there is no match at all, I only receive the one row with NULL and I would like to see a row for each date from start to stop.
    SELECT  T1.IDNumber,T1.StartDate,T1.StopDate,T3.SignDateTime
    FROM
    Table1 T1
    INNER
    JOIN Table2
    T2
    ON
    T1.CustID
    = T2.CustID
    LEFT
    JOIN Table3
    T3
    ON
    T1.CustID
    = T3.CustID
    WHERE
    T1.StartDate
    > '2015-01-20 00:00:00.000'
    AND
    (T3.ReportID
    IN ('DOC1',
    'DOC2',
    'DOC3') OR
    T3.ReportID
    IS NULL)
    AND
    T2.YesNo
    = 'Y'

  • Reminder for delivery date in PO

    Hi,
    I have a requirement related to reminder for delivery date.
    For ex i have PO in which the delivery date is 20th NOV 09.I want there should be the reminder alret message to be send to personal mail or to SAP mail before the delivery date approches automatically.
    I do not want to open the PO for checking the delivery date.
    If possible then pls explain the detailed process for config the scenario.
    Regards,
    DD

    Reminder letters are send to the vendor, not to the buyer.
    I think your "reminders" can be done more easily with scheduled standard reporting.
    use ME2L,  
    use selection parameter WE101 for open receipts.
    enter todays date in delivery date field
    press F2 while cursor is in delivery date field and select the sign for lower and equal.
    fill your other selection criteria, such as purchasing group, scope of list etc.
    Then save as variant.
    enter variant name and description
    scroll to the right and put the cursor into row for delivery date into field selection variable.
    press F4 and select Dynamic date calculation
    put the cursor in the same row into the field name of variable and press F4
    then enter I for include and EQ  for the Current date
    now save your variant.
    execute SM36 to define your batch job.
    enter a job name e.g. ME2L_reminders.
    click button spool receipients.
    you get a popup, here enter the the users email adress and click copy.
    then click button start conditions to define when the job shall run.
    then click STEP button
    enter as program name RM06EL00
    enter your variant name.
    enter the language that the report shall have.
    then save.
    From now on the buyer will receive a list with all overdue deliveries as often as you scheduled the job.

  • Re: Transactions and Locking Rows for Update

    Dale,
    Sounds like you either need an "optimistic locking" scheme, usually
    implemented with timestamps at the database level, or a concurrency manager.
    A concurrency manager registers objects that may be of interest to multiple
    users in a central location. It takes care of notifying interested parties
    (i.e., clients,) of changes made to those objects, using a "notifier" pattern.
    The optimistic locking scheme is relatively easy to implement at the
    database level, but introduces several problems. One problem is that the
    first person to save their changes "wins" - every one else has to discard
    their changes. Also, you now have business policy effectively embedded in
    the database.
    The concurrency manager is much more flexible, and keeps the policy where
    it probably belongs. However, it is more complex, and there are some
    implications to performance when you get to the multiple-thousand-user
    range because of its event-based nature.
    Another pattern of lock management that has been implemented is a
    "key-based" lock manager that does not use events, and may be more
    effective at managing this type of concurrency for large numbers of users.
    There are too many details to go into here, but I may be able to give you
    more ideas in a separate note, if you want.
    Don
    At 04:48 PM 6/5/97 PDT, Dale "V." Georg wrote:
    I have a problem in the application I am currently working on, which it
    seems to me should be easily solvable via appropriate use of transactions
    and database locking, but I'm having trouble figuring out exactly how to
    do it. The database we are using is Oracle 7.2.
    The scenario is as follows: We have a window where the user picks an
    object from a dropdown list. Some of the object's attributes are then
    displayed in that window, and the user then has the option of editing
    those attributes, and at some point hitting the equivalent of a 'save'button
    to write the changes back to the database. So far, so good. Now
    introduce a second user. If user #1 and user #2 both happen to pull up
    the same object and start making changes to it, user #1 could write back
    to the database and then 15 seconds later user #2 could write back to the
    database, completely overlaying user #1's changes without ever knowing
    they had happened. This is not good, particularly for our application
    where editing the object causes it to progress from one state to the next,
    and multiple users trying to edit it at the same time spells disaster.
    The first thing that came to mind was to do a select with intent to update,
    i.e. 'select * from table where key = 'somevalue' with update'. This way
    the next user to try to select from the table using the same key would not
    be able to get it. This would prevent multiple users from being able to
    pull the same object up on their screens at the same time. Unfortunately,
    I can think of a number of problems with this approach.
    For one thing, the lock is only held for the duration of the transaction, so
    I would have to open a Forte transaction, do the select with intent to
    update, let the user modify the object, then when they saved it back again
    end the transaction. Since a window is driven by the event loop I can't
    think of any way to start a transaction, let the user interact with the
    window, then end the transaction, short of closing and re-opening the
    window. This would imply having a separate window specifically for
    updating the object, and then wrapping the whole of that window's event
    loop in a transaction. This would be a different interface than we wanted
    to present to the users, but it might still work if not for the next issue.
    The second problem is that we are using a pooled DBSession approach
    to connecting to the database. There is a single Oracle login account
    which none of the users know the password to, and thus the users
    simply share DBSession resources. If one user starts a transaction
    and does a select with intent to update on one DBSession, then another
    user starts a transaction and tries to do the same thing on the same
    DBSession, then the second user will get an error out of Oracle because
    there's already an open transaction on that DBSession.
    At this point, I am still tossing ideas around in my head, but after
    speaking with our Oracle/Forte admin here, we came to the conclusion
    that somebody must have had to address these issues before, so I
    thought I'd toss it out and see what came back.
    Thanks in advance for any ideas!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    >
    >
    >
    >
    ====================================
    Don Nelson
    Senior Consultant
    Forte Software, Inc.
    Denver, CO
    Corporate voice mail: 510-986-3810
    aka: [email protected]
    ====================================
    "I think nighttime is dark so you can imagine your fears with less
    distraction." - Calvin

    We have taken an optimistic data locking approach. Retrieved values are
    stored as initial values; changes are stored seperately. During update, key
    value(s) or the entire retieved set is used in a where criteria to validate
    that the data set is still in the initial state. This allows good decoupling
    of the data access layer. However, optimistic locking allows multiple users
    to access the same data set at the same time, but then only one can save
    changes, the rest would get an error message that the data had changed. We
    haven't had any need to use a pessimistic lock.
    Pessimistic locking usually involves some form of open session or DBMS level
    lock, which we haven't implemented for performance reasons. If we do find the
    need for a pessimistic lock, we will probably use cached data sets that are
    checked first, and returned as read-only if already in the cache.
    -DFR
    Dale V. Georg <[email protected]> on 06/05/97 03:25:02 PM
    To: Forte User Group <[email protected]> @ INTERNET
    cc: Richards* Debbie <[email protected]> @ INTERNET, Gardner*
    Steve <[email protected]> @ INTERNET
    Subject: Transactions and Locking Rows for Update
    I have a problem in the application I am currently working on, which it
    seems to me should be easily solvable via appropriate use of transactions
    and database locking, but I'm having trouble figuring out exactly how to
    do it. The database we are using is Oracle 7.2.
    The scenario is as follows: We have a window where the user picks an
    object from a dropdown list. Some of the object's attributes are then
    displayed in that window, and the user then has the option of editing
    those attributes, and at some point hitting the equivalent of a 'save' button
    to write the changes back to the database. So far, so good. Now
    introduce a second user. If user #1 and user #2 both happen to pull up
    the same object and start making changes to it, user #1 could write back
    to the database and then 15 seconds later user #2 could write back to the
    database, completely overlaying user #1's changes without ever knowing
    they had happened. This is not good, particularly for our application
    where editing the object causes it to progress from one state to the next,
    and multiple users trying to edit it at the same time spells disaster.
    The first thing that came to mind was to do a select with intent to update,
    i.e. 'select * from table where key = 'somevalue' with update'. This way
    the next user to try to select from the table using the same key would not
    be able to get it. This would prevent multiple users from being able to
    pull the same object up on their screens at the same time. Unfortunately,
    I can think of a number of problems with this approach.
    For one thing, the lock is only held for the duration of the transaction, so
    I would have to open a Forte transaction, do the select with intent to
    update, let the user modify the object, then when they saved it back again
    end the transaction. Since a window is driven by the event loop I can't
    think of any way to start a transaction, let the user interact with the
    window, then end the transaction, short of closing and re-opening the
    window. This would imply having a separate window specifically for
    updating the object, and then wrapping the whole of that window's event
    loop in a transaction. This would be a different interface than we wanted
    to present to the users, but it might still work if not for the next issue.
    The second problem is that we are using a pooled DBSession approach
    to connecting to the database. There is a single Oracle login account
    which none of the users know the password to, and thus the users
    simply share DBSession resources. If one user starts a transaction
    and does a select with intent to update on one DBSession, then another
    user starts a transaction and tries to do the same thing on the same
    DBSession, then the second user will get an error out of Oracle because
    there's already an open transaction on that DBSession.
    At this point, I am still tossing ideas around in my head, but after
    speaking with our Oracle/Forte admin here, we came to the conclusion
    that somebody must have had to address these issues before, so I
    thought I'd toss it out and see what came back.
    Thanks in advance for
    any
    ideas!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    ------ Message Header Follows ------
    Received: from pebble.Sagesoln.com by notes.bsginc.com
    (PostalUnion/SMTP(tm) v2.1.9c for Windows NT(tm))
    id AA-1997Jun05.162418.1771.334203; Thu, 05 Jun 1997 16:24:19 -0500
    Received: (from sync@localhost) by pebble.Sagesoln.com (8.6.10/8.6.9) id
    NAA11825 for forte-users-outgoing; Thu, 5 Jun 1997 13:47:58 -0700
    Received: (from uucp@localhost) by pebble.Sagesoln.com (8.6.10/8.6.9) id
    NAA11819 for <[email protected]>; Thu, 5 Jun 1997 13:47:56 -0700
    Received: from unknown(207.159.84.4) by pebble.sagesoln.com via smap (V1.3)
    id sma011817; Thu Jun 5 13:47:43 1997
    Received: from tes0001.macktrucks.com by relay.macktrucks.com
    via smtpd (for pebble.sagesoln.com [206.80.24.108]) with SMTP; 5 Jun
    1997 19:35:31 UT
    Received: from dale by tes0001.macktrucks.com (SMI-8.6/SMI-SVR4)
    id QAA04637; Thu, 5 Jun 1997 16:45:51 -0400
    Message-ID: <[email protected]>
    Priority: Normal
    To: Forte User Group <[email protected]>
    Cc: "Richards," Debbie <[email protected]>,
    "Gardner," Steve <[email protected]>
    MIME-Version: 1.0
    From: Dale "V." Georg <[email protected]>
    Subject: Transactions and Locking Rows for Update
    Date: Thu, 05 Jun 97 16:48:37 PDT
    Content-Type: text/plain; charset=US-ASCII; X-MAPIextension=".TXT"
    Content-Transfer-Encoding: quoted-printable
    Sender: [email protected]
    Precedence: bulk
    Reply-To: Dale "V." Georg <[email protected]>

  • Not Getting Rows With No Date Match

    I have SQL 2012 and am trying to use a CTE to get patient meal calendar rows even if the row does not match a given date range. We use a Calendar table that has 1 row for each date in the year so I wanted it to drive the results so that when I ask for a
    week date range I will get rows even if the patient does not have a meal or snack scheduled for that date.  My CTE code is below and it gives me the correct data but only if the patient has a meal or snack scheduled for that date (this is like a weekly
    meal menu). Any help is appreciated.
    ALTER PROCEDURE [dbo].[kd_selMealPlannerMatrix]
    @PatientID int,
    @StartDate smalldatetime,
    @EndDate smalldatetime = null
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    IF @EndDate IS NULL
    BEGIN
    SET @EndDate = DATEADD(day,6,@StartDate);
    END
    ;WITH client_meals AS (
    SELECT DATEPART(dw, dbo.tblMealCalendar.MealDate) AS PrintDate,
    dbo.tlkpMealCodes.MealCode,
    CASE WHEN dbo.tblMealCalendar.MealID <> 0 THEN dbo.tblActualMeals.MealName + N' - ' + CONVERT(nvarchar, dbo.tblActualMeals.MealNumber)
    WHEN dbo.tblMealCalendar.SnackID <> 0 THEN dbo.tblActualSnacks.SnackName + N' - ' + CONVERT(nvarchar, dbo.tblActualSnacks.SnackNumber)
    ELSE NULL
    END AS PrintMeal,
    dbo.tblMealCalendar.PatientID,
    dbo.tblMealCalendar.MealDate,
    dbo.tblMealCalendar.CalendarID,
    dbo.tlkpMealCodes.MealCodeSort,
    dbo.tblActualMeals.MealID,
    dbo.tblActualSnacks.SnackID,
    dbo.tblMealCalendar.MealCodeID
    FROM dbo.tblMealCalendar LEFT OUTER JOIN
    dbo.tblActualMeals ON dbo.tblMealCalendar.MealID = dbo.tblActualMeals.MealID LEFT OUTER JOIN
    dbo.tblActualSnacks ON dbo.tblMealCalendar.SnackID = dbo.tblActualSnacks.SnackID LEFT OUTER JOIN
    dbo.tlkpMealCodes ON dbo.tblMealCalendar.MealCodeID = dbo.tlkpMealCodes.MealCodeID
    WHERE (dbo.tblActualSnacks.Verified IS NULL OR dbo.tblActualSnacks.Verified <> 0)
    AND (dbo.tblActualMeals.Verified IS NULL OR dbo.tblActualMeals.Verified <> 0)
    AND (dbo.tblMealCalendar.PatientID = @PatientID)
    ), dt_range AS (
    SELECT dt, DW
    FROM dbo.Calendar
    WHERE dt BETWEEN @StartDate AND @EndDate
    SELECT
    MAX(M.MealDate) AS MealDate,
    MAX(M.PrintDate) AS PrintDay,
    MAX(D.DW) AS WkDay,
    MAX(CASE WHEN MealCode = 'AM Meal' THEN PrintMeal
    ELSE NULL
    END) AS AMMeal,
    MAX(CASE WHEN MealCode = 'AM Meal' THEN MealID
    ELSE 0
    END) AS AMMealID,
    MAX(CASE WHEN MealCode = 'AM Snack' THEN PrintMeal
    ELSE NULL
    END) AS AMSnack,
    MAX(CASE WHEN MealCode = 'AM Snack' THEN SnackID
    ELSE 0
    END) AS AMSnackID,
    MAX(CASE WHEN MealCode = 'Mid-Day' THEN PrintMeal
    ELSE NULL
    END) AS MidDay,
    MAX(CASE WHEN MealCode = 'Mid-Day' THEN MealID
    ELSE 0
    END) AS MidDayMealID,
    MAX(CASE WHEN MealCode = 'PM Snack' THEN PrintMeal
    ELSE NULL
    END) AS PMSnack,
    MAX(CASE WHEN MealCode = 'PM Snack' THEN SnackID
    ELSE 0
    END) AS PMSnackID,
    MAX(CASE WHEN MealCode = 'PM Meal' THEN PrintMeal
    ELSE NULL
    END) AS PMMeal,
    MAX(CASE WHEN MealCode = 'PM Meal' THEN MealID
    ELSE 0
    END) AS PMMealID,
    MAX(CASE WHEN MealCode = 'Evening Snack' THEN PrintMeal
    ELSE NULL
    END) AS EveningSnack,
    MAX(CASE WHEN MealCode = 'Evening Snack' THEN SnackID
    ELSE 0
    END) AS EveningSnackID,
    MAX(CASE WHEN MealCode = '4th Meal' THEN PrintMeal
    ELSE NULL
    END) AS FourthMeal,
    MAX(CASE WHEN MealCode = '4th Meal' THEN MealID
    ELSE 0
    END) AS FourthMealID
    FROM dt_range AS D RIGHT OUTER JOIN
    client_meals AS M ON D.dt = M.MealDate
    GROUP BY D.dt
    HAVING (D.dt BETWEEN @StartDate AND @EndDate)
    ORDER BY D.dt;
    END

    I tried to keep this as close to what we know as I could. Here's an example of making it work as you're asking:
    DECLARE @tinyCalendar table (date date)
    DECLARE @i INT = 0
    WHILE @i < 10
    BEGIN
    INSERT INTO @tinyCalendar (date)
    VALUES (DATEADD(DAY,-@i,GETDATE()))
    SET @i = @i + 1
    END
    DECLARE @patients TABLE (id INT IDENTITY, name VARCHAR(20))
    INSERT INTO @patients (name)
    VALUES ('John'),('Paul'),('George'),('Ringo')
    DECLARE @mealSelections TABLE (patientID INT, mealID INT, mealCode VARCHAR(8), DATE DATE)
    INSERT INTO @mealSelections (patientID, mealID, mealCode, date)
    VALUES
    (1,1,'1st Meal','2014-08-12'),(1,2,'1st Meal','2014-08-13'),(1,3,'1st Meal','2014-08-14'),(1,4,'1st Meal','2014-08-15'),(2,1,'1st Meal','2014-08-12'),(2,2,'1st Meal','2014-08-13'),(2,3,'1st Meal','2014-08-14'),(2,4,'1st Meal','2014-08-15'),(3,1,'1st Meal','2014-08-12'),(3,2,'1st Meal','2014-08-13'),(3,3,'1st Meal','2014-08-14'),(3,4,'1st Meal','2014-08-15'),(4,1,'1st Meal','2014-08-12'),(4,2,'1st Meal','2014-08-13'),(4,3,'1st Meal','2014-08-14'),(4,4,'1st Meal','2014-08-15'),
    (1,1,'1st Meal','2014-08-16'),(1,2,'1st Meal','2014-08-17'),(1,3,'1st Meal','2014-08-18'),(1,4,'1st Meal','2014-08-19'),(2,1,'1st Meal','2014-08-16'),(2,2,'1st Meal','2014-08-17'),(2,3,'1st Meal','2014-08-18'),(2,4,'1st Meal','2014-08-19'),(3,1,'1st Meal','2014-08-16'),(3,2,'1st Meal','2014-08-17'),(3,3,'1st Meal','2014-08-18'),(3,4,'1st Meal','2014-08-19'),(4,1,'1st Meal','2014-08-16'),(4,2,'1st Meal','2014-08-17'),(4,3,'1st Meal','2014-08-18'),(4,4,'1st Meal','2014-08-19'),
    (1,1,'2nd Meal','2014-08-12'),(1,2,'2nd Meal','2014-08-13'),(1,3,'2nd Meal','2014-08-14'),(1,4,'2nd Meal','2014-08-15'),(2,1,'2nd Meal','2014-08-12'),(2,2,'2nd Meal','2014-08-13'),(2,3,'2nd Meal','2014-08-14'),(2,4,'2nd Meal','2014-08-15'),(3,1,'2nd Meal','2014-08-12'),(3,2,'2nd Meal','2014-08-13'),(3,3,'2nd Meal','2014-08-14'),(3,4,'2nd Meal','2014-08-15'),(4,1,'2nd Meal','2014-08-12'),(4,2,'2nd Meal','2014-08-13'),(4,3,'2nd Meal','2014-08-14'),(4,4,'2nd Meal','2014-08-15'),
    (1,1,'2nd Meal','2014-08-16'),(1,2,'2nd Meal','2014-08-17'),(1,3,'2nd Meal','2014-08-18'),(1,4,'2nd Meal','2014-08-19'),(2,1,'2nd Meal','2014-08-16'),(2,2,'2nd Meal','2014-08-17'),(2,3,'2nd Meal','2014-08-18'),(2,4,'2nd Meal','2014-08-19'),(3,1,'2nd Meal','2014-08-16'),(3,2,'2nd Meal','2014-08-17'),(3,3,'2nd Meal','2014-08-18'),(3,4,'2nd Meal','2014-08-19'),(4,1,'2nd Meal','2014-08-16'),(4,2,'2nd Meal','2014-08-17'),(4,3,'2nd Meal','2014-08-18'),(4,4,'2nd Meal','2014-08-19'),
    (1,1,'3rd Meal','2014-08-12'),(1,2,'3rd Meal','2014-08-13'),(1,3,'3rd Meal','2014-08-14'),(1,4,'3rd Meal','2014-08-15'),(2,1,'3rd Meal','2014-08-12'),(2,2,'3rd Meal','2014-08-13'),(2,3,'3rd Meal','2014-08-14'),(2,4,'3rd Meal','2014-08-15'),(3,1,'3rd Meal','2014-08-12'),(3,2,'3rd Meal','2014-08-13'),(3,3,'3rd Meal','2014-08-14'),(3,4,'3rd Meal','2014-08-15'),(4,1,'3rd Meal','2014-08-12'),(4,2,'3rd Meal','2014-08-13'),(4,3,'3rd Meal','2014-08-14'),(4,4,'3rd Meal','2014-08-15'),
    (1,1,'3rd Meal','2014-08-16'),(1,2,'3rd Meal','2014-08-17'),(1,3,'3rd Meal','2014-08-18'),(1,4,'3rd Meal','2014-08-19'),(2,1,'3rd Meal','2014-08-16'),(2,2,'3rd Meal','2014-08-17'),(2,3,'3rd Meal','2014-08-18'),(2,4,'3rd Meal','2014-08-19'),(3,1,'3rd Meal','2014-08-16'),(3,2,'3rd Meal','2014-08-17'),(3,3,'3rd Meal','2014-08-18'),(3,4,'3rd Meal','2014-08-19'),(4,1,'3rd Meal','2014-08-16'),(4,2,'3rd Meal','2014-08-17'),(4,3,'3rd Meal','2014-08-18'),(4,4,'3rd Meal','2014-08-19'),
    (1,1,'4th Meal','2014-08-12'),(1,2,'4th Meal','2014-08-13'),(1,3,'4th Meal','2014-08-14'),(1,4,'4th Meal','2014-08-15'),(2,1,'4th Meal','2014-08-12'),(2,2,'4th Meal','2014-08-13'),(2,3,'4th Meal','2014-08-14'),(2,4,'4th Meal','2014-08-15'),(3,1,'4th Meal','2014-08-12'),(3,2,'4th Meal','2014-08-13'),(3,3,'4th Meal','2014-08-14'),(3,4,'4th Meal','2014-08-15'),(4,1,'4th Meal','2014-08-12'),(4,2,'4th Meal','2014-08-13'),(4,3,'4th Meal','2014-08-14'),(4,4,'4th Meal','2014-08-15'),
    (1,1,'4th Meal','2014-08-16'),(1,2,'4th Meal','2014-08-17'),(1,3,'4th Meal','2014-08-18'),(1,4,'4th Meal','2014-08-19'),(2,1,'4th Meal','2014-08-16'),(2,2,'4th Meal','2014-08-17'),(2,3,'4th Meal','2014-08-18'),(2,4,'4th Meal','2014-08-19'),(3,1,'4th Meal','2014-08-16'),(3,2,'4th Meal','2014-08-17'),(3,3,'4th Meal','2014-08-18'),(3,4,'4th Meal','2014-08-19'),(4,1,'4th Meal','2014-08-16'),(4,2,'4th Meal','2014-08-17'),(4,3,'4th Meal','2014-08-18'),(4,4,'4th Meal','2014-08-19')
    SELECT p.id, p.name, c.date,
    Max(CASE WHEN mealCode = '1st Meal' THEN mealID END) AS FirstMeal,
    Max(CASE WHEN mealCode = '2nd Meal' THEN mealID END) AS SecondMeal,
    Max(CASE WHEN mealCode = '3rd Meal' THEN mealID END) AS ThirdMeal,
    Max(CASE WHEN mealCode = '4th Meal' THEN mealID END) AS FourthMeal
    FROM @patients p
    INNER JOIN @tinyCalendar c
    ON p.id = p.id
    LEFT OUTER JOIN @mealSelections m
    ON p.id = m.patientID
    AND m.date = c.date
    GROUP BY p.id, p.name, c.date
    ORDER BY c.date

  • Bug in Data Collection Changes By Row for Dynamic domains?

    Hello,
    I was using the Data Collection Changes By Row? option on one of my dynamic domains.
    This resulted in a nullpointer exception for selected items on the jspx page.
    After some searching I found this was because the appmodule was null.
    And this was cause by the generated domains beans.xml.
    The generated code was:
    <property-name>applicationModule</property-name>
    <value>#{data.<appmodule datacontrol name>.dataProvider}</value>While it should have been:
    <property-name>applicationModule</property-name>
    <value>#{data.<appmodulename>DataControl.dataProvider}</value>I think this is related to me setting the datacontrolname on the appmodule under custom properties. But I think JHS should be able to detect that?
    Anton

    Anton,
    Currently JHeadstart has no support for customized data control names. However, I have added it to our list of enhancement requests.
    As a workaround, you can customize the Generator Template for the domains bean.
    kind regards,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Using htp.p for print dynamic data in apex region make my page slow?

    Hi, everyone!!! My name is Rafael, and...
    I search in the web and in this forum but i can´t find a answer for my doubt.
    Using the procedure htp.p for print dynamic data in apex region through on demand process , this will leave my webpage slow to load when the user access?
    Example:
    For build a menu in my webpage, it´s read a function in the database that returns variable string, so by a demand process this string is obtain and print in a web page using htp.p.
    I notice that this practice causes slow to load the data on the page.
    This is it...
    If someone help me, thanks...
    bye and Happy new Year!!!
    Edited by: user9518141 on 26/12/2009 17:19

    Hi,
    Try commenting out the function call and print some sample text in the htp.p like htp.p('Hello world..');
    I think the function call is probably taking a lot of time .. not htp.p.
    I have used htp.p to print out values dynamically in a lot of situations and have not ever come across any performance issues.It could be a problem with the function you are calling.
    Thanks,
    Rajesh.

  • How do you save dynamic data type, from the DAQ assistant, for use in Excel or matlab?

    Currently, I have the following basic VI setup to save Data from my PCI6221 Data Aquisition Card.  The problem I'm having is I keep getting the last iteration of the while loop in the measurement file and that's pretty much it.  When I try to index the data leaving the loop it gives me a 2D array of Data which cannot be input into the "Write to Measurement File" VI.  How would I save this to a useful Data/time step format?  I was wondering of a way to continuously collect the Data and then save it in a large measurement file that I would manipulate in Matlab/excel?  Am I using the wrong type of loop for this application?  I also noticed my Dynamic Data array consists of data, time, timestep and then a vector of the data taken.  Is it possible to just get a vector of the time change per sample alongside the data?    Sorry for the barrage of questions but any help would be greatly appreciated, and thanks in advance!
    -Bryan
    Attachments:
    basic DAQ.vi ‏120 KB

    There is a VI in the Express > Signal Manipulation palette called "From DDT" that lets you convert from the Dynamic Data Type to other data types that are more compatible with operations like File I/O....for instance, you could convert your DDT into a 2D array and use the Write To Spreadsheet File.vi.  Just a thought...
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Dynamic Date Calculation for Current Date - 1

    I am trying to create a variant with a dynamic date calculation attribute.
    I am following the instructions as they are posted to the web but I get an error message.
    I want to get all data EQ to the current date -1
    In the object for selection screen I enter a D for Selection Variable, for Name of Variable I enter an I to include specific values and the option EQ for current date +/- ??? days.  Then I enter 1- for the number of days.  I have tried to enter this many times and in many ways but it doesn't work.  I keep getting this message "lower limit of interval is greater than upper limit"

    Hi,
    Welcome to SDN.
    Selection-screen has four values -
    SIGN
    OPTION
    LOW
    HIGH
    Pass your date value in the option low for the screen.
    Sign you have already pass as I and option as EQ.
    Regard,
    Amit
    Reward all helpful replies.
    Can you paste your code here.
    Message was edited by:
            Amit Khare

  • Alternatives to dynamic tables for displaying dynamic data

    What methods are available for displaying data from MySQL
    with PHP on a web page? Is there any alternative to a dynamic table
    when the the quantity of data will vary? anything CSS based?
    Many Thanks

    On 27 May 2006 in macromedia.dreamweaver, Pingus mum wrote:
    > so i could just output to a div for example?
    Or a paragraph, or an <h4>, or an unordered list, or
    any other container
    tag, or the src attribute on an <img> tag, or any
    combination of the
    above. Consider the case where the database consists of press
    releases -
    date, headline, body. You could, say, make the repeat region
    like this:
    <h1>Press Releases</h1>
    <!-- start of repeat region -->
    <h2><& headlineFromDatabase &></h2>
    <p><& dateFromDatabase &> - <&
    bodyFromDatabase &></p>
    <!-- end of repeat region -->
    <address>Contact Information</address>
    Joe Makowiec
    http://makowiec.net/
    Email:
    http://makowiec.net/email.php

  • How to configure Dynamic Data Connection for Business View

    Hi,
    How can we configure Dynamic Data connection that we can save the profile of the connection to somewhere that we do not need to enter it everytime when we refresh the report?
    thanks and regards
    nora

    Hi James,
    Thanks for the reply. Its solved now. For anybody if interested you can set the dynamic email address either i) having it as part of payload - In this case use the xpath to query the payload varaible ii) use identity service - follow the following steps
    1.Create a user in Application enterprise manager/also you can use a existing account, if u are creating a new one assign the correct role
    2. In either case edit the user-properties.xml(bpel/system/services/config) file for the corresponding user and add an attribute called email
    3. Bounce the server for this changes to take effect
    4. In the notification properties in the to address use ids:getUserProperty and pass the attribute name

  • Internationalization for dynamic data

    HI ..i want to know how to do internationalization for dynamic data that is from database...
    Please let me know
    Thanks in advance
    Rams

    HI
    You can do the trick by extending ResourceBundle (or ListResourceBundle) and write your own handleGetObject and getKeys method.
    But in that case you are forced to create different classes for different locales and follow the naming convention for bundles:
    If your class for the default locale is MyResourceBundle, then for all the other locales you have to create a class called "MyResourceBundle_"+localeName .
    But I don't know how can I bypass this strange behaviour. All the getBundle, and getBundleImpl methods are static. So if a framework call your class through ResourceBundle.getBundle() static method you are forced to do this. If you want to change you have to call your class. So you need to instantiate your ResuorceBundle class yourself.
    Bence

  • Dynamic Date Variant for SAP Job

    Hi Guru
    We have a program to be ran in the Background .
    I am unable to create a Variant for Date ( Current year Jan 01st to  Current Date).
    Could you please advice how to create a Variant with Dynamic Date Calculation for above date range.
    Thanks in Advance.
    Thanks
    Ravi

    Hi,
    I guess that you know how manage dynamic dates in a variant. (Please, tell me if you need help about it)
    You can try with two DATUM type fields in the ABAP program. Fix the first one with a fixed date u201901.01.2009u2019 and the second one will be fixed with the dynamic date u2018Current Dateu2019
    Regards,
    OLA

Maybe you are looking for

  • How to setup and use Passbook on iPhone 4?

    How to setup and use Passbook on iPhone 4?

  • Q10(unlocked)-black at the reduced price($299)

    Today,I found that the price of Q10(unlocked)-black on the shopblackberry has been cut down from $399 to $299. I'm from China.I want to buy one to use in my country.So,i need to know if it's  compatible with me.So,i have some questions to ask: 1.I wa

  • ADF Horizontal bar graph issue

    Hi All, JDev Version: 11.1.2.4 I have one user case ,where I need to show data values on x1-o1 axis . but o1 axis data should display on right side instead of left. is there any way to do this. I went through some blogs, there is one tag markerText .

  • Assign a postable commitment item to the G/L account.

    Hi Team, Please write me  procedure for "Assign a postable commitment item to the G/L account." Thanks

  • Database access question

    How does Discoverer work in regards to accessing the data (not the EUL tables)? If the owner of the tables is left blank in the EUL, does it use the User Id of the person logging into the tool or does it use the owner of the EUL? I know in Business O