How to create table with dynamic rows

Hi Ppl,
I have an array lets say with length of n. I want to creata table with 2 columns and no of rows = array length.
lets say array length is 3 ( array[0] = 1, array[1] = 2, array[2] = 3) so the table should have 2 columns and 3 rows.
After creation of table I want to display each array value in each row.
Can somebody help me in this asap.
Thanks \
Ashish

Hi, Thanks for reply... actually this is one part of rtf. I have put values from xml to an array and now I want to create a table with no of rows = length of array. so here xml will not be useful. could you pls think of it without xml.
result is like
lets says below is the array
array[0] = a
array[1] = b
array[2] = c
array length = 3
so there should be a table of 2 coulmns and 3 rows. Second column of first row will show 'a', Second column of second row wil show 'b' and Second column of third row will show 'c'.
Hope this is useful.
Thakns
Ashish

Similar Messages

  • How to create table with resizable row ?

    how to create table with resizable row ?

    I'd suggest you start here:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • How to create table with 1 row 1MB in size?

    Hello,
    I am doing some R&D and want to create a Table with 1 row, which is 1 MB in size.
    i.e. I want to create a row which is 1 MB in size.
    I am using a 11g DB.
    I do this in SQL*Plus:
    (1.) CREATE TABLE onembrow  (pk NUMBER PRIMARY KEY, onembcolumn CLOB);
    (2.) Since 1MB is 1024*1024 bytes (i.e. 1048576 bytes) and since in English 1 letter = 1 byte, I do this
    SQL> INSERT INTO onembrow VALUES (1, RPAD('A', 1048576, 'B'));
    1 row created.
    (3.) Now, after committing, I do an analyze table.
    SQL> ANALYZE TABLE onembrow COMPUTE STATISTICS;
    Table analyzed.
    (4.) Now, I check the actual size of the table using this query.
    select segment_name,segment_type,bytes/1024/1024 MB
    from user_segments where segment_type='TABLE' and segment_name='ONEMBROW';
    SEGMENT_NAME       
    SEGMENT_TYPE        
    MB
    ONEMBROW           
    TABLE            
    .0625
    Why is the size only .0625 MB, when it should be 1 MB?
    Here is the DB Block related parameters:
    SELECT * FROM v$parameter WHERE upper(name) LIKE '%BLOCK%';
      NUM NAME                                                                                   TYPE VALUE 
      478 db_block_buffers                                                                          3 0     
      482 db_block_checksum                                                                         2 TYPICAL
      484 db_block_size                                                                             3 8192  
      682 db_file_multiblock_read_count                                                             3 128   
      942 db_block_checking                                                                         2 FALSE 
    What am I doing wrong here???

    When testing it is necessary to do something that is a reasonably realistic model of a problem you might anticipate appearing in a production system - a row of 1MB doesn't seem likely to be a useful source of information for "R&D on performance tuning"
    What's wrong with creating millions of rows ?
    Here's a cut and paste from a windows system running 11.2.0.3
    SQL> set timing on
    SQL>
    SQL> drop table t1 purge;
    Table dropped.
    Elapsed: 00:00:00.04
    SQL>
    SQL> create table t1
      2  nologging
      3  as
      4  with generator as (
      5     select
      6             rownum id
      7     from dual
      8     connect by
      9             level <= 50
    10  ),
    11  ao as (
    12     select
    13             *
    14     from
    15             all_objects
    16     where   rownum <= 50000
    17  )
    18  select
    19     rownum          id,
    20     ao.*
    21  from
    22     generator       v1,
    23     ao
    24  ;
    Table created.
    Elapsed: 00:00:07.09
    7 seconds to generate 2.5M rows doesn't seem like a problem.  For a modelling example I have one script that generates 6.5M (carefully engineered) rows, with a couple of indexes and a foreign key or two, then collects stats (no histograms) in 3.5 minutes.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    Now on Twitter: @jloracle

  • How to create table with dynamic amount of columns which are nested columns

    M trying to fetch data and show in a javaFX table.
    My table displays the details of different items from ItemVO , where :
    public class ItemVO()
    String itemName;
    List<ItemTypeVO> type;
    and My ItemTypeVO has the following attributes :
    public class ItemTypeVO()
    String typeName;
    Integer quantity;
    Integer price;
    Now, i want to display the details of an item in a table in which the itemname and quantity will be displayed, the quantity column will have nested columns showing different types(typeName) as found from List<ItemTypeVO> inside ItemVO.
    This question is similar to this link but my not able to find how to link a list with itemVO for nested columns. :(
    Please help !!
    M still unable to find a solution..
    Edited by: abhinay_a on Jan 14, 2013 10:50 AM

    Hi Abhilash,
    Thanks for the quick reply.
    Actually the problem is with the image, as I am not able to rotate 270 degree. Crystal report cannot support the rotation of image.
    i have another problem, I have to create a report in which
    Lables are fixed on the left side of report and 3 columns per portrait page. Those columns are
    dynamically created and shown in the report.
    The format is like the above. Can you please help me in doing this report, as I tried it doing
    with CrossTab. I am really stuck to this report.

  • Trying to create table with dynamic rows

    First off, I'm a noob. This is a homework assignment I'm working on. I'm trying to create an Amortization Table based on a user's selection of different term/interest rate combinations. I need a table that has four columns: Payment Month 1-12, Monthly Payment Amount, Interest Paid, and Remaining Principle. But I need the rows to change based on the user's selection of a radio button. I have three radio buttons: 7 years at 5.35% interest, 15 years at 5.5% interest, and 30 years at 5.75% interest. I'll need anywhere from 180 rows to 360 rows; one row for each monthly payment.
    I'm not sure about my approach to this, but I created a JTable named 'amortTable' and I'm using the DefaultTableModel. I'm using a for loop to step through the calculations until the principle balance is zero. I'm apparently not doing something right, as the data is not populating in the table. Here's the code in question. I didn't post my full code, but let me know if it's needed and I will.
    import java.io.*;
    import javax.swing.*;
    import javax.swing.table.*;
    javax.swing.JTable amortTable = new javax.swing.JTable();
    javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
    private void init Components()
    ... //extra code omitted
    amortTable.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][]
    {null, null, null, null}
    new String []
    "Payment No.", "Payment Amount", "Interest Paid", "Remaining Principle"
    jScrollPane1.setViewportView(amortTable);
    .... //extra code omitted
    }//end initComponents
    private void calculateButtonActionPerformed(java.awt.event.ActionEvent evt)
    ... //extra code omitted
    while (loanAmount>0)
    for (int i = 0; i < 12; i++)
    interestPaid = loanAmount * monthlyRate;
    principlePaid = monthlyPymt - interestPaid;
    loanAmount = loanAmount - principlePaid;
    pymtNo = pymt;
    amortTable.addRow(new Object[]{pymtNo, monthlyPymt, interestPaid, loanAmount});
    }//end for loop
    }//end while loop
    }//end calculateButtonActionPerformed
    My goal was to use the for loop to continue to add rows containing the specified variables to amortTable until the principle balance reached zero.I get a compiler error that says "cannot find symbol / symbol: method addRow(java.lang.Object[]) / location: class javax.swing.JTable). I'm pretty sure it has to do with the fact that the table is located in a different method than the for loop, but I don't know how to check for that. I also don't believe that the problem is with the method itself, but rather a syntax error elsewhere. Any ideas? Or if I'm going about this the wrong way, can someone point me in the right direction?

    Hello and welcome. Some observances.
    1) You seem to be trying to call addRow on amortTable, a JTable object, and these beasts shouldn't have that method. Rather you would call this method on the DefaultTableModel object held by this JTable.
    2) Please read the FAQ to see how to use code tags to make your code readable when posting it here.
    3) I find when I have difficulty like this, it is always better to try to solve the problem in a very simple program first and then use that info in the larger program. So in that light, why not create a very simple program that tries to add simple rows to a JTable on button press. Solve your problem here and you've solved it for the big program. Fail to solve it and you can always post the whole simple program here which will be a lot easier for us to read and understand than your big program.
    Much luck!

  • How to create table with row type in smart forms

    How to create table with row type in smart forms with out line type
    please explain me the procedure

    HI,
    A table type describes the structure and functional attributes of an internal table in ABAP. In ABAP programs you can reference a table type TTYP defined in the ABAP Dictionary with the command DATA <inttab> TYPE TTYP. An internal table <inttab> is created in the program with the attributes defined for TTYP in the ABAP Dictionary.
    A table type is defined by:
    its line type, that defines the structure and data type attributes of a line of the internal table
    the options for managing and accessing the data ( access mode) in the internal table
    the key ( key definition and key category) of the internal table
    The row type is defined by directly entering the data type, length and number of decimal places or by referencing a data element, structured type ( structure, table or view) or other table type. Or the row type can be a reference type.
    <b>for more info :</b> http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm
    Internal table
    Regards
    Sudheer

  • How to display data in table with dynamic rows, section wise in a page.

    Hello all,
    I work on report creation in BI Publisher where I need to display data from xml in a table in pdf format.The output page is divided into two vertical sections , containing tables, with exactly same columns on left and right sections. The number of rows in table depends on the output of the fetching query. The page is to be populated in such a way that, at first, the left table is populated, then the next rows fill up the table on the right section of the page, if more rows are left, they fill up the tables on next page[first the left table, and then the right one, in a similar fashion as in page 1]
    On a bird's eye view, the data needs to be simply mapped to a table, with dynamic number of rows, and so can span number of pages depending on size of data. On a implementation level, I am stuck in getting the left section of the page populated first, then the right section[in place of the right page], and then the next page.
    Please guide me if someone has any idea in getting this achieved.
    Thanks in advance.

    Thanks for the response...
    I am able to get the desired functionality. I just need the tables to be inside a bigger table, that also has a dividing line between the two columns. This is was is intended in the req. provided to me. The column formatting option provides me a line ,but that is not further modifiable .Please help me in getting a perpendicular line between the two columns, which I need to be of a specified width and color.

  • How to create table with rows and columns in HTMLB

    Hello All,
    Can any one tell me how to create table in HTMLB?
    Regards,
    Lisa.

    Look at the sample BSP application SBSPEXT_HTMLB
    also you can look at the below Blog..
    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
    <i>*Reward each useful answer</i>
    Raja T

  • How to create table columns dynamically ?

    Hi All,
    I am working on an SSRS report that will show sales in the past 5 years. If the user selected to view sales of past 3 years he will only see 3 columns. so How can I create table columns dynamically at run time and how can I make sure that their dimensions
    will adjust to fit the report page size.

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • How to create table with table description

    Hi,
    I would like create table with table description(like creating package or procedure with comments).
    Is it possible to achieve through oracle, if possible please help me how to achieve this.
    Thanks and regards,
    Ibrahim Sayyed.

    > create table test (col1 number);
    > comment on table test is 'this is a comment';
    > select comments from user_tab_comments where table_name = 'TEST';
    COMMENTS
    this is a comment

  • How to create report with dynamic columns with static row labels

    Hi All,
    I am creating one report as per attached format. I have labels on the right side of the report
    and data in 3 columns. The data is taken dynamically from the command query.
    It gets data from 3 different result sets/command queries.
    I tried creating the report horizontally instead of vertically, but the logo image I am not able to rotate in 270degrees.
    Can anybody tell me how to create the report...??

    Hi Abhilash,
    Thanks for the quick reply.
    Actually the problem is with the image, as I am not able to rotate 270 degree. Crystal report cannot support the rotation of image.
    i have another problem, I have to create a report in which
    Lables are fixed on the left side of report and 3 columns per portrait page. Those columns are
    dynamically created and shown in the report.
    The format is like the above. Can you please help me in doing this report, as I tried it doing
    with CrossTab. I am really stuck to this report.

  • How to create table with rows and columns in the layout mode?

    One of my friends advised me to develop my whole site on the
    layout mode as its better than the standard as he says
    but I couldnot make an ordinary table with rows and columns
    in th layout mode
    is there any one who can tell me how to?
    thanx alot

    Your friend is obviously not a reliable source of HTML
    information.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Mr.Ghost" <[email protected]> wrote in
    message
    news:f060vi$npp$[email protected]..
    > One of my friends advised me to develop my whole site on
    the layout mode
    > as its
    > better than the standard as he says
    > but I couldnot make an ordinary table with rows and
    columns in th layout
    > mode
    > is there any one who can tell me how to?
    > thanx alot
    >

  • How To Create Table with Static Data

    JDEV 10.1.3
    ADF BC
    ADF Faces
    I am trying to make some simple screen/screenflow diagrams to help flesh out some requirements. To do that, I need to make a table with static data that is not hooked up to a data source (because the data model has not yet been clearly defined, and I'm using the diagrams to help iterate the requirements).
    Is it possible to create a table that shows static data (i.e. a set of rows that does not come from a model data source, but rather is hardcoded.)
    If not, how does one create mock ups without actually implementing the data model?
    Thank you.

    Deepak, what specifically in those 2 links from Amis are useful? Those 2 posts are about bind variables, not static list of values?
    In response to the original poster, I'll attempt to help a little more.
    In the 11g release you can create VOs based on a static list of values. However in your case on 10.1.3, the best method I've found is to create a VO based on a SELECT <columns> FROM DUAL statement. The columns then include your dummy data. If you need more than one row, simply UNION ALL a number of SELECT statements together.
    What I haven't checked, is when you eventually transform the VO based on the SELECT DUAL statement into a VO based on an EO drawing real data from the database, is it an easy process? I recommend you try this out before committing to the approach above. Let us know how you go.
    Regards,
    CM.

  • ERROR creating table with dynamic SQL :-(

    Hi friends,
    I have a problem when I try to create a table using dynamic SQL.
    (Env.: Forms 6i, WinXP, Oracle 9i)
    I only want to create a table, insert data and drop the table.
    I have a user with the correct privileges (At least ....I think so), because I can to make the three actions in SQL*PLUS (CREATE TABLE, INSERT .. and DROP TABLE).
    I want to do the same in Forms using dynamic SQL...
    I've made a package with 3 procedures:
    1st to create the table, 2nd to insert data , 3rd to drop the table.
    Only the 1st fails with the error ORA-01031 (insufficient privileges).
    Here it is:
    PROCEDURE PRO_DM_CreaTabla(pe_nombre_tabla VARCHAR2) IS
    id_cursor INTEGER;
    ls_sentencia VARCHAR2(500);
    v_dummy integer;
    BEGIN
    id_cursor := DBMS_SQL.OPEN_CURSOR;
    ls_sentencia := 'CREATE TABLE '||pe_nombre_tabla||' ( campo1 VARCHAR2(100), campo2 VARCHAR2(100), campo3 VARCHAR2(100),campo4 VARCHAR2(100))';
    DBMS_SQL.PARSE(id_cursor, ls_sentencia, dbms_sql.NATIVE);
    v_dummy := dbms_sql.execute(id_cursor);
    DBMS_SQL.CLOSE_CURSOR(id_cursor);
    END;
    The DROP_table procedure is exactly the same as this (with the difference of the 'CREATE' sentence, where I have a DROP sentence)... then.. why the DROP procedure works?... and.. why this CREATE procedure doesn't work?
    Any ideas?
    Thanks a lot.
    Jose.

    From a different thread, Jose wrote:
    V_INSERT:='INSERT INTO TMP_TABLE(field1,field3,field3,field4) VALUES (1,2,3,4)';
    Forms_DDL(V_INSERT);
    commit;First, try your statement in SQL Plus:
    INSERT INTO TMP_TABLE(field1,field3,field3,field4) VALUES (1,2,3,4);
    Then if that works, try doing this right after the Forms_DDL(V_INSERT);
    If not form_success then
      Message('   Insert has failed');
      Raise form_trigger_failure;
    Else
      Forms_DDL('COMMIT');
    End if;

  • How to create table with variable

    hi,
    i m to create many table with same starting name but last name would be vary like
    i m to create table test121 and test122 and so on
    i want to set name test then any given number by variable so i can create many table.
    so how to add it in create table command.
    i tried create table test||:var (column names) but it didnt work.
    so plz suggest me how to do it ?
    thxs

    Actually this is good.
    It has nothing to do with database design. A database is not a garbage bin.
    You need to do several things
    a) make sure your design is normalized so you don't have identical tables.
    b) In future posts specify a platform and a version and the tool you are using to create the table
    c) if the tool is sql*plus learn about substitution variables aka DEFINEs.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Error #1065: Variable  is not defined on ObjectUtil??

    One comment to Adobe, it would be nice if the debugger would output better errors. Maybe it's just my lack of experience, but trying to track down errors is a daunting task. I had spent an entire night trying to track down this error and it has come

  • Dlink router + external drive for itunes library?

    I have a MBP who is slowly running out of space... I have a dlink router 826L with a 2TB external hard drive that is plugged in by usb into the router. dlink has settings to set it up as storage, but it wants to use a sharepoint software thing. I wan

  • Vendor wise last purchase/grn date

    Hi Experts, Please quote if any statndar report is available to vendor wise last purchase/grn date for a partcular pur org or plant. Regards

  • Inheretence is driving me crazy, help a n00bie out.

    I am driven insane by inheratance. In class we are using Blue J. The book we have does not have a good example. If anyone knows how inheretance is supposed to work and how to work multi inheretance with print statements please help me out. If I were

  • IPhone Calendar Sync in A Mess with iCloud

    The calendars on my iCloud are not reflected on my iPhone but are all present on my iPad. I have only oneaccount so there is no way the 2 device are on 2 different account. Both devices are upto date with IOS 5.0 Another issue I have is that there is