Should I have a table column with total price?

Hello,
I have the following SQL Scheme:
create table dbo.Baskets (
Id int not null primary key clustered (Id),
Name nvarchar (80) not null
create table dbo.Products (
Id int not null primary key clustered (Id),
BasketId int not null,
Price decimal (10, 2) not null,
Name nvarchar (80) not null
So one basket can have many products.
I often need to find baskets in a specific price range.
I know the basket price is the sum of its products prices.
**QUESTIONS**
1. Should I add a column to Baskets with TotalPrice?
2. Would this improve query performance a lot?
3. Can this be done automatically when Products are updated?
4. Should I index some column here?
Thank You,
Miguel

1.It depends on the queries run against the table 
2.May or may not, depends how would like to calculate it or you get already calculated value for the client or whatever
3. Yes, but then you will have to write a trigger at least
4. Depends on the queries and columns  that participate in WHERE clause
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • Move Table Column with AppleScript in Microsoft Word

    Microsoft Word has a flaw (in my opinion) with tables in that it aligns the left and right text with the margins rather than aligning the table columns with the margins. This results in sloppy tables, because the left and right borderlines lie outside the margins.
    I would like to fix the word tables by
    calculating the left cell padding and right cell padding in points and setting them to variables {left_pad,right_pad} respectively
    move left column by left_pad to the right
    move right column by right_pad to the left
    The script I was working on does not work, but I will post it to show my thought process as I hone in on my solution.
    tell application "Microsoft Word"
        --595 points is width of A4 paper
        -- Set page margin in points to variables
        set {l_margin, r_margin, t_margin, b_margin} to {(get left margin of page setup of active document), get (right margin of page setup of active document), get (top margin of page setup of active document), get (bottom margin of page setup of active document)}
        get {l_margin, r_margin, t_margin, b_margin}
        -- Set specific Paragraph margins
        -- NOTE: If you select a table thinking you wish to drag just the left margin to the right, or the right margin to the left, this code does not accomplish this because each cell has its own paragraph formatting. This code will set the margin for every single cell, because each cell has its own margins! (separate from padding).
        set para_sel to paragraph format of selection
        set paragraph format left indent of para_sel to (centimeters to points centimeters 0.5)
        -- Aligning left and right columns of table with the margins
        -- NOTE: There is a command to set left row indent, but not right row indent (very stupid of Microsoft)
    end tell

    I have worked up something that seems to work (although I cannot promise it is the best way). Hope it helps anyone else who has this need.
    tell application "Microsoft Word"
    activate
    set findRange to find object of selection
    clear formatting findRange -- clear any previous formatting used in a find operation
    set forward of findRange to true -- find forward
    set style of findRange to "List Bullet" -- the style to look for
    tell findRange
    set gotIt to execute find find text "" -- do the search w/o matching any text
    end tell
    if gotIt is true then -- if a match was found
    copy object selection -- copy it to the clipboard
    set mySelection to (the clipboard) -- then put clipboard into a variable
    set myOffset to ¬
    (get selection information selection information type ¬
    (horizontal position relative to page)) -- now put selection info into a variable
    display dialog mySelection & return & (myOffset as text) -- then display it
    end if
    end tell

  • Is it possible to have 2 separate accounts with totally different and independent music on the same computer?

    IS it possible to have 2 separate accounts with totally different music libraries on same computer with multiple iPods synced to the computer,

    Same answer as last time you asked the same question.
    Can I create 2 separate itune accounts on same PC?

  • Hiding Table Columns with the Spry Element Selector

    I am trying to set up a toggle button that will show/hide
    rows >1 when clicked. I've used Adobe's
    "Hiding
    Table Columns with the Spry Element Selector" example and it
    worked fine with an HTML list, until I linked to actual XML data.
    Now it works in reverse. What gives?
    Here's the example:
    http://a44.awardspace.com/testing/toggleShowHideRows.htm

    That's what I started with. Same result:
    http://a44.awardspace.com/testing/toggleShowHideRows.htm

  • I have a table tab1 with record(1,2,3,4,5,6,7,8,9). i want to create a proc

    i have a table tab1 with record(1,2,3,4,5,6,7,8,9). i want to create a procedure, when we pass the parameter in procedure then that record come on top rest record below of that.
    thanks,

    Is the block based on a table ?
    Francois

  • PO with Total Price amount calculated is incorrect at the time of printing.

    Hi Experts,
    I have one PO with Total Price amount calculated is incorrect at the time of printing.
    When my  user took the first print out the PO shows the incorrect Total amount.
    After 10 mins my user taken the printout again,that time it shows the Toatal Price value is correct amount.
    How i can analysis this type of BUG..!!!
    I am thinking it might be BUG...???
    Please advice with you valuable inputs.
    Best Regards,
    RK

    Hi,
    Are you using the standard programm and print form or are you using your own?. Most of the printing issues happens because of own programms. Try with the standard and then you will be able to see why is this happening.
    Best Regards,
    Arminda Jack

  • Indices and constraints on XML Tables/Columns (with Schema)

    Hi,
    I've read a lot of documents by know, but the more I read the more I got confused. So I hope you can help me.
    Frist my Oracle Server Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
    I've manages to create a table with a column with the type SYS.XMLTYPE and the storage modle "Object Relational" with an XML Schema.
    I can insert data and I can execute XQuery statements.
    I can also create an XMLTYPE table with my Schema, althoug the tool SQL Developer keeps telling me, that the one column wich is generated within the table is of the type CLOB instead of object realtional (which is what I defined).
    The query for that is:
    CREATE TABLE ENTRY_XML OF XMLTYPE
    XMLTYPE STORE AS OBJECT RELATIONAL
    XMLSCHEMA "BBMRI_Entry.xsd" ELEMENT "Entry";
    That's where I am, now my questions:
    1. What's the difference? I'm aware of the obviouse difference, that with the first way I can add relational columns as well, but apart from that? If I only want to store the xml data, is the second approach always better (especially in regard to my next question)?
    2. My schema contains elements with attributes (which contain IDs), which have to be unique. So I tried to add a UNIQUE constraint, but failed. I found this (http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/constraints/Specify_Constraints.html), but it just doesn't work.
    Query: "ALTER TABLE ENTRY_XML CONSTRAINT ENTRY_XML_SUBID_UNQIUE UNIQUE (xmldata."SubId");"
    Error: "ORA-01735: invalid ALTER TABLE option"
    3. I didn't try yet, but I need to specifiy foreign keys within the XML as well (which is explained in the link at question 2). I guess the solution to question 2 will make this possible as well.
    4. Since I can create a UNIQUE constaint for attributes (well, I can't yet, but I hope that this will change soon) I woundered if it would be possible to realize something like auto_increment. Although I see the problem with validating the xml input if the Ids are empty. Any suggestions on that problem? Do I have to query for the highest (free) id before I can insert the new documents?
    Well, that's enough for today, I hope someone can help me!
    Greetings, Florian

    I've read through all the literature (again) and found out, that I did most of the stuff right in the first place. I just missinterpreted the generated tables for the types and wondered why they only contained one column. Well, at least one mistery solved.
    But know to make it easier just one question, which might solve all problems I have:
    How can I create UNIQUE constraints and FOREIGN KEYS when I have a table or column of the type XmlType with a schema using the object relational storage method?
    I found a solution http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb05sto.htm#i1042421 (Example 5-12), but it just does not work for me.
    I removed the FOREIGN KEY and tried it again and the UNIQUE Key works.
    So basically the question is how to retrieve the "AId" Attribute. "XMLDATA"."AId", "XMLDATA"."Attribute"."AId" and "XMLDATA"."Subject"."Attribute"."AId" all do not work.
    I've added my schema declarations at the bottom (which I've already successfully registred and used without foreign keys and constraints, so they work).
    After I've registered the two schema files 3 types and 11 tables where created. One type for the attribute, one for the study type and one probably to link the attributes to the study types. The tables are one for the attribute, 4 for the content*-elements, 2 for the study type (I don't really know why two) and 4 with strange names starting with "SYS_NT" and then some random numbers and letters (looks alot like some base64 encoded string).
    The Query I try to use to create the table is: (The table "Attribute" already exists and contains a field "ID", which is it's PK.)
    CREATE TABLE STUDYTYPE_XML
    OF XMLType (UNIQUE ("XMLDATA"."STId"),
    FOREIGN KEY ("XMLDATA"."AId") REFERENCES ATTRIBUTE(ID))
    XMLTYPE STORE AS OBJECT RELATIONAL
    ELEMENT "StudyType.xsd#StudyType";
    The error I get is:
    Error starting at line 1 in command:
    CREATE TABLE STUDYTYPE_XML
    OF XMLType (UNIQUE ("XMLDATA"."STId"),
    FOREIGN KEY ("XMLDATA"."AId") REFERENCES ATTRIBUTE(ID))
    ELEMENT "StudyType.xsd#StudyType"
    Error at Command Line:3 Column:37
    Error report:
    SQL Error: ORA-22809: nonexistent attribute
    22809. 00000 - "nonexistent attribute"
    Cause: An attempt was made to access a non-existent attribute of an
    object type.
    Action: Check the attribute reference to see if it is valid. Then retry
    the operation.
    Attribute-Schema (Attribute.xsd):
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:attribute name="AId">
              <xs:simpleType>
                   <xs:restriction base="xs:integer">
                        <xs:minInclusive value="0" />
                   </xs:restriction>
              </xs:simpleType>
         </xs:attribute>
         <xs:attribute name="Name" type="xs:string" />
         <xs:element name="ContentString" type="xs:string" />
         <xs:element name="ContentInteger" type="xs:integer" />
         <xs:element name="ContentDouble" type="xs:decimal" />
         <xs:element name="ContentDate" type="xs:date" />
         <xs:element name="Attribute">
              <xs:complexType>
                   <xs:choice minOccurs="0" maxOccurs="1">
                        <xs:element ref="ContentString" />
                        <xs:element ref="ContentInteger" />
                        <xs:element ref="ContentDouble" />
                        <xs:element ref="ContentDate" />
                   </xs:choice>
                   <xs:attribute ref="AId" use="required" />
                   <xs:attribute ref="Name" use="optional" />
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Study Type Schema (StudyType.xsd):
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:include schemaLocation="Attribute.xsd" />
         <xs:attribute name="STId">
              <xs:simpleType>
                   <xs:restriction base="xs:integer">
                        <xs:minInclusive value="0" />
                   </xs:restriction>
              </xs:simpleType>
         </xs:attribute>
         <xs:element name="StudyType">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Attribute" minOccurs="1" maxOccurs="unbounded" />
                        <xs:element ref="StudyType" minOccurs="0" maxOccurs="unbounded" />
                   </xs:sequence>
                   <xs:attribute ref="STId" use="required"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Edited by: alwaysspam on Sep 8, 2010 5:35 PM

  • Custom sort pivot table columns with Essbase as the data source

    Is it possible to sort columns in a pivot table according to an arbitrary value that I define when the data is coming from Essbase?
    For example, say I have a dimension called Soda, with values Coke, Diet Coke, Dr. Pepper and Diet Dr. Pepper. I create a report with a sales measure with the measure labels on the rows and the Soda dimension on the column. By default the columns will be sorted alphabetically:
    Coke Diet Coke Diet Dr. Pepper Dr. Pepper
    Sales 1M .5M .75M 1.25M
    I want to create a report that looks like this:
    Coke Diet Coke Diet Dr. Pepper Dr. Pepper
    Sales
    I think I could do this if the source was relational just by creating bins or creating a custom column with a case statement that assigns each Soda an arbitrary value and then sort on this value. Everything I've tried with Essbase as the source, though, results in:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42043] An external aggregate is found in an outer query block. (HY000)
    Any ideas?

    Hi,
    1. You can try solve the 'An external aggregate is found in an outer query block' by changing aggregation rule for your measure both in physical and business layer.
    By default it's set to Aggr_External - change it to Sum
    In physical : Column properties->Aggregation rule
    In business model : Column properties->Aggregation tab -> Default aggregation rule.
    This may change the result - after changing check whether you still get correct values.
    2. Also, in case the desired order is the same as the order of members in the Essbase cube, and you want to leave Aggr_External, you can create a calculated column that will help you with the sort.
    See http://oraclebizint.wordpress.com/2008/04/28/oracle-bi-ee-101332-handling-sort-order-in-hyperion-essbase-931-evaluate-and-mdx/
    Hope this helps,
    Alex

  • Impact of table columns with number datatype but has no precision in Forms

    Hi.
    Currently, I have table columns that have a data type of number but has no precision declared (e.g. AGREEMENT_CODE NUMBER). I would just like to ask if there's anyone out there who knows if this has a negative impact on Oracle's forms and reports...with the way buffer memories are allocated or other things on performance. I am still putting in maximum length values for base table items. I don't know if this will affect buffer memory allocation as well.
    Thank you.

    I don't know this for fact, but I would think that numbers with a large number of significant figures might affect buffer sizes, but I'll bet your example AGREEMENT_CODE values would never have a large number of figures. In fact, whether or not you limit the size of a number in the database or your form probably does not affect the way the actual data values are transmitted or stored.
    If someone is telling you to worry about this, I think they are barking up the wrong tree someplace way out in left field.
    There are so many other things that can seriously affect processing speed and data transfer speed, starting with query plans and index usage. I have never heard this one causing concern anywhere before.

  • SQL from Table Column with Dynamic URL Problem

    This is the SQL I'm attempting to save to a table column via the Object Browser;
    select
    "a"."PBR_BRIEF_ID" "Brief ID",
    "a"."PROJECT_NUMBER" "Project",
    "b"."DESCRIPTION" "Description",
    "b"."ACTUAL_END_DATE" "Actual End",
    "b"."RFS_DATE" "RFS",
    "b"."LOCATION_CODE" "Location",
    ''||"b"."ESA_CODE"||'' "ESA",
    "b"."PROJECT_USER_STATUS" "Status",
    "b"."PROJECT_TRIGGER" "Trigger"
    from
    UPT1TRIAL.FUND_PLAN_BRIEF_LINK_CCR@NDSD "a",
    UPT1INTEGRAL.INT_PROJECT_DATA@NDSD "b"
    where
    "a"."PBR_BRIEF_ID" = :P3_BRIEF_ID and
    "a"."PROJECT_NUMBER" = "b"."PROJECT_DEFINITION_NUMBER"
    The intesting bit is the following, where a URL is return behind a particular column;
    ''||"b"."ESA_CODE"||'' "ESA",
    It's interesting because when I click on "Apply Changes" in the Object Browser, the text that appears in the column is as follows, i.e. with APP_ID and SESSION populated;
    ''||"b"."ESA_CODE"||'' "ESA",
    Why would that happen??
    The full SQL above is used in an application page with a SQL Query (PL/SQL function body returning SQL query). The basic SQL works OK but because of what the Object Browser is doing, the link does not.
    Message was edited by:
    Damian - apologies for lack of formatting!!
    Message was edited by:
    Damian

    Damian,
    Use
    & lt;
    for your &lt; tags and then the message will appear in the proper format.
    If you are using dynamic sql to generate an url with APP_ID and SESSSION you could:
    a) create page items (P1_APP_ID and P1_SESSION)
    b) compute those page items to the actual APP_ID and SESSION_ID
    c) use the value of those items while generating your dynamic sql (instead of APP_ID and SESSION)
    Then, your links will show the right APP_ID and the right SESSION.
    Denes Kubicek

  • How to populate a table column with marked text?

    I hate searching and typing so I was just wondering if there was a solution to the following problem.
    I have a document that contains 5-character defect codes in the body of the text (in numbered steps). At the end of the document I have a table which summarizes these codes: the codes make up one column and the other columns contain information related to these codes (page number, area, actions to be taken, criteria for defect etc.).
    Is there a way for me to mark the codes such that I could import all of them into the defect code column?
    I was leaning towards generating a list of some kind and then pasting it in the column but I can't seem to paste my generated list into multiple cells. FM will only allow me to paste the whole list in one cell. Am I using the wrong approach or maybe missing a step in between?

    Thank you! that was very helpful and it solves my problem to a great degree. I didn't think of converting the list to a table--now I just have to delete the page numbers, since they are included in the table, but in another column
    FYI, I couldn't use cross-reference markers because the defect code (according to the style guide.) is written at the end of the instruction, on the same line without a hard return. Cross referencing brought in all the text in that paragraph if I used a <paratext> building block to define my cross-reference format. I lack the knowledge to create a cross-reference format that would just give me the last five characters of the paragraph. These tables tend to be long and even if I could do that, for each row, I would have to click about seven or eight times per entry 
    Thanks again.

  • Update table column with same auto-increment value, via T-SQL stored procedure

    Good Evening to every one,
    I have a table 'Contracts' as we can see in the picture below (I exported my data on An Excel Spreadsheet). Table's primary key is 'ID' column.
    I am trying to create a stored procedure (i.e. updContractNum), through which I am going to update the 'Contract_Num' column, in every row where the values on Property_Code, Customer, Cust_Category and Amnt ARE EQUAL, as we can see in the schema above.
    The value of Contract_Num is a combination of varchar and auto_increment (integer). For example, the next value on 'Contract number' column will be 'CN0005' for the combination of 11032-14503-02-1450,00
    I' m trying to use CURSORS for this update but I am new in using cursors and I am stuck in whole process. I atttach my code below:
    CREATE PROCEDURE updContractNum
    AS
    --declare the variables
    DECLARE @CONTRACT_NUM VARCHAR(10); -- Contract Number. The value that will be updated on the table.
    DECLARE @CONTRACT INTEGER; -- Contract number, the auto increment section on contract number
    DECLARE @CONTR_ROW VARCHAR(200); -- Contract row. The row elements that will be using on cursor
    DECLARE CONTRACT_CURSOR CURSOR FOR -- Get the necessary fields from table
    SELECT PROPERTY_CODE, CUSTOMER, CUST_CATEGORY, AMNT
    FROM CONTRACTS;
    OPEN CONTRACT_CURSOR -- open a cursor
    FETCH NEXT FROM CONTRACT_CURSOR INTO @CONTR_ROW
    WHILE @@FETCH_STATUS = 0 -- execute the update, for every row of the tabl
    BEGIN
    --update Contract_Num, using the format coding : contract_number = 'CN' + 0001
    UPDATE CONTRACTS
    SET CONTRACT_NUM = 'CN'+@CONTRACT_NUM+1
    END
    CLOSE CONTRACT_CURSOR
    Thank you in advance!

    You dont need cursor
    You can simply use an update statement like this
    UPDATE t
    SET Contract_Num = 'CN' + RIGHT('00000' + CAST(Rnk AS varchar(5)),5)
    FROM
    SELECT Contract_Num,
    DENSE_RANK() OVER (ORDER BY Property_Code,Customer,Cust_category,Amnt) AS Rnk
    FROM table
    )t
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to change the css behaviour of af:table column with rowheader

    Hi
    Can we change the css look and feel of the af:column with rowheader attribute set true ? Currently I am getting a projected look with shades in the left side. I want it to be like normal af:column style. If there any specific styleClass I need to put please provide the details
    THanks
    Suneesh

    Hi,
    you can use skinning for this. The skin selectors are shown here:
    http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e15862/toc.htm
    Frank

  • Fill a table column with an empty value as the column is not existing in the data file

    Hello,
    I m new to SQL loader
    I have a table like this :
    CREATE table ListeEcriture
    ( "NUMERO" varchar2 (8 bytes)
    "dateEcr" varchar (10 byte)
    "CodeOp" Varchar2 (10 byte)
    "LibOp" varchar (32 byte)
    "CodeVal" varchar (12 byte)
    "NumCompte" varchar (8 bytes)
    This is my control file :
    load data
    infile 'C:\ReQ\FR00010303.txt'
    into table ListeEcriture
    fields terminated by ";"
    (numero, DateEcr, CodeOp, libOp, CodeVal "FR00010303", NumCompte)
    The problem is thataslo if possible to ignore the file header it would be really great

    You might be after SQL*Loader Control File Reference
    Check SQL*Loader Concepts for the big picture.
    Regards
    Etbin

  • How to make table column with formula

    Hi all..
    This is my class
    public class MyNumber{
         private int num;
         public int getNum(){
              return num;
         public void setNum( int num){
              this.num = num;
    }Consider I design a table with FXML editor ( Scene Builder in this case )
    and these are some of my codes
    private TableView tab;
    private TableColumn<MyNumber, Integer> tabColInput;
    private TableColumn tabColOutput;
    tab.setEditable(true);
    tabColInput.setEditable(true);
    tabColInput.setCellValueFactory( new PropertyValueFactory<Person,Integer>("num") );
    tabColInput.setCellFactory(TextFieldTableCell.forTableColumn());
    tabColInput.setOnEditCommit(
        new EventHandler<CellEditEvent<MyNumber, Integer>>() {
            @Override
            public void handle(CellEditEvent<MyNumber, Integer> t) {
                ((MyNumber) t.getTableView().getItems().get(
                    t.getTablePosition().getRow())
                    ).setNum(t.getNewValue());
    );Problem:
    I want to make tabColOutput to always show the result for tabColInput times 2
    eg:
    When I change a row in tabColInput to 10, tabColOutput will show 20
    When I change a row in tabColInput to 3, tabColOutput will show 6
    Could anyone advice me how to do this?
    Ps: I am not english native speaker, so I am sorry if I am saying it wrong ^^

    I just give it a try and it works like magic
    Here is how I do it (change a cell from a table by code)
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.geometry.Insets;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.VBox;
    import javafx.scene.text.Font;
    import javafx.stage.Stage;
    public class TableViewSample extends Application {
        public static final String Column1MapKey = "A";
        public static final String Column2MapKey = "B";
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(Stage stage) {
            List<MyTableData> listData = new ArrayList<MyTableData>();
            listData.add(new MyTableData("A", 21) );
            listData.add(new MyTableData("B", 24) );
            listData.add(new MyTableData("C", 23) );
            listData.add(new MyTableData("D", 21) );
            listData.add(new MyTableData("E", 22) );
            ObservableList<MyTableData> tableData = FXCollections.observableArrayList(listData);
            Scene scene = new Scene(new Group());
            stage.setTitle("Table View Sample");
            stage.setWidth(300);
            stage.setHeight(500);
            final Label label = new Label("Student IDs");
            label.setFont(new Font("Arial", 20));
            TableColumn<MyTableData, String> firstDataColumn = new TableColumn<MyTableData, String>("NAME");
            TableColumn<MyTableData, Integer> secondDataColumn = new TableColumn<MyTableData, Integer>("AGE");
            firstDataColumn.setCellValueFactory(new PropertyValueFactory<MyTableData, String>("name"));
    //        firstDataColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<MyTableData, String>, ObservableValue<String>>(){
    //            @Override
    //            public ObservableValue<String> call(CellDataFeatures<MyTableData, String> p) {
    //                return p.getValue().nameProperty();
            firstDataColumn.setMinWidth(130);
            secondDataColumn.setCellValueFactory(new PropertyValueFactory<MyTableData, Integer>("age"));
            secondDataColumn.setMinWidth(130);
            TableView<MyTableData> table_view = new TableView<MyTableData>();
            table_view.setItems(tableData);
            table_view.getColumns().setAll(firstDataColumn, secondDataColumn);
            final VBox vbox = new VBox();
            vbox.setSpacing(5);
            vbox.setPadding(new Insets(10, 0, 0, 10));
            vbox.getChildren().addAll(label, table_view);
            ((Group) scene.getRoot()).getChildren().addAll(vbox);
            stage.setScene(scene);
            stage.show();
            //(this is where I change my table content with code)
            tableData.get(0).setName("xx Gargoyle xx");
            System.out.println("Testing Done");
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.property.StringProperty;
    public class MyTableData{
        private final SimpleStringProperty name;
        private int age;
        public MyTableData(String name, int age) {
            this.name = new SimpleStringProperty(name);
            this.age = age;
        public String getName() {
            return name.get();
        public StringProperty nameProperty(){
            return name;
        public void setName(String name) {
            this.name.set(name);
        public int getAge() {
            return age;
        public void setAge(int age) {
            this.age = age;
    }And thank you very much

Maybe you are looking for

  • In mail.app I only get 4 emails at a time

    Hello, since I updated to  OS X Lion, I'm having problems with the Mail.app. Bassically when I ask it yo get new mail, it onley get 4 email at a time. After that I have to press again the Get Mail button to get more mail. Does anyone have something l

  • Best practice for a distributed BI4 deployment?

    Hello Experts, Need suggestion on the following? We plan to deploy the BI4 software across 6 Servers (1 node on each server) We plan to dedicate 2 servers for the Management/Intelligent tier and 4 servers for the processing Tier (Webi, crystal and da

  • Apple TV and Time Capsule Compatibility

    can i directly wire apple TV to time capsule to stream movies?

  • Availability of Online Bill

    My online bill says that my next bill is due 24 december BUT apparently it takes 48 hours (YES 48 hours!!!!) for BT to upload a bill after it is "generated" (they probably use BT Broadband) so my next bill will not in fact be available to view until

  • GR based IV used in conjunction with Evaluated Receipt Settlement question

    If we are using GR based IV, does the ERS process use the value of the goods receipt to create the invoice?