Cannot add column to flexible table when ddl autocommit is off using Procedure

Hello All,
Through procedure I am trying to insert data into the target(EX_92) table(with schema flexibility)
Source table data
ID
PRODUCT_CODE
PRODUCT_NAME
PRICE
COLOR
TYPE
1
1
rugg
101.22
2
1
rugg
101.22
3
2
book
200.32
BLUE
Y
Target table QUERY
drop table EX_P2;
CREATE COLUMN TABLE EX_P2(
ID INTEGER PRIMARY KEY,
PRODUCT_CODE VARCHAR(3),
PRODUCT_NAME NVARCHAR(20),
PRICE DECIMAL(5,2)
) WITH SCHEMA FLEXIBILITY;
Procedure to insert above records with additional columns into the target table(EX_P2)
Procedure
drop procedure "DS_O1"."PROC";
create procedure "DS_O1"."PROC"(IN max_value INTEGER, IN schema_name varchar(40), IN table_name varchar(40), IN column_list varchar(400))
LANGUAGE SQLSCRIPT  AS
BEGIN
DECLARE maxid integer :=0;
DECLARE INSERT_STR VARCHAR(1000) :='';
select max(ID) into maxid from "DS_O1"."EX_P2";
select :maxid from dummy;
INSERT_STR :='insert into "' || 'DS_O1' ||'"."EX_P2" ('||:column_list||') (select ' ||:column_list||'
  FROM "'||:schema_name||'"."'||:table_name||'"' || ' where  ID  >' || :max_value  || ')';
EXECUTE immediate(:INSERT_STR);
END;
Now while executing above procedure
CALL "DS_O1"."PROC" ( 0, 'DS_O1', 'TMP_EXL2','ID,PRODUCT_CODE,PRODUCT_NAME,PRICE,COLOR,STATUS,TYPE');
I am getting the following error
Could not execute 'CALL "DS_O1"."PROC" ( 0, 'DS_O1', 'TMP_EXL2','ID,PRODUCT_CODE,PRODUCT_NAME,PRICE,COLOR,STATUS,TYPE')' in 23 ms 564 µs .
SAP DBTech JDBC: [7]: feature not supported:  [7] "DS_O1"."PROC": line 18 col 1 (at pos 779): [7] (range 3): feature not supported: cannot add column to flexible table when ddl autocommit is off

Hi Rajnish,
I had the same issue. For what it’s worth I was able to do a workaround basically creating all the columns when I create the table. The following code works for me to create the table which is just a matrix with one Integer column as the key and the rest as type Double.
It is not ideal in all scenarios because the table columns cannot be added dynamically via a procedure at a later point. This table has 27K columns now
Of course one of the advantages of a flex table would be programmatically adding columns dynamically. This works, but maybe there is still a way to add columns dynamically from a procedure, and someone else can advise.
Apparently dynamically adding columns via procedures may have some "minor" limitations due to the need to compile the procedure with knowledge of the flex table DDL. But again, hopefully someone knows another solution.
Best regards,
Mark
DROP PROCEDURE CREATE_MATRIX;
CREATE PROCEDURE CREATE_MATRIX(
    LANGUAGE SQLSCRIPT
    SQL SECURITY INVOKER
    AS
/*********BEGIN PROCEDURE SCRIPT ************/
BEGIN
    -- cursor over messages
    declare cursor matrix_cursor for
        select distinct TERM
        from TERMS
        order by term;
       declare cnt INTEGER := 0;
       declare temptxt NVARCHAR(500000) := 'CREATE COLUMN TABLE DOC_MATRIX ( CONTENT_ID INTEGER ';
    for cur_matrix as matrix_cursor do
      cnt:=:cnt + 1;
           select temptxt || ', C' || cnt || ' DOUBLE' into temptxt from dummy;
    end for;
      temptxt:=temptxt || ' ) WITH SCHEMA FLEXIBILITY';
       EXEC :temptxt;
       select :temptxt from dummy;
END;
DROP TABLE DOC_MATRIX;
CALL CREATE_MATRIX();

Similar Messages

  • ORA-22856: cannot add columns to object tables

    Oracle 9i
    ==========
    I tried to alter a table using a simple script.
    ALTER TABLE tablename ADD col VARCHAR(50);
    And it gave me the error: -
    ORA-22856: cannot add columns to object tables
    Can someone give me some direction on how to resolve this? The script executes fine on a test env.
    Thanks in advance

    Thanks for replying...
    exit     Null? Type
    BUS     NUMBER
    REP     VARCHAR2(60)
    COS     NUMBER
    REP     VARCHAR2(50)
    ACC     NUMBER
    ADJ     VARCHAR2(2000)
    BAS     NUMBER
    BIL     VARCHAR2(360)
    BIL     VARCHAR2(50)
    BIL     VARCHAR2(3)
    BIL     VARCHAR2(50)
    BLP     VARCHAR2(240)
    BLP     NUMBER
    BOO     DATE
    COM     NUMBER
    COM     NUMBER
    COM     NUMBER(15)
    COM     NUMBER(15)
    COM     VARCHAR2(4000)
    COM     VARCHAR2(30)
    CUR     NUMBER
    CUS     VARCHAR2(240)
    DEA     VARCHAR2(240)
    EVE     VARCHAR2(240)
    HEA     VARCHAR2(240)
    HEA     VARCHAR2(240)
    HEA     VARCHAR2(240)
    HEA     VARCHAR2(240)
    INC     VARCHAR2(30)
    INV     DATE
    MAN     VARCHAR2(360)
    ORD     NUMBER
    ORD     VARCHAR2(240)
    PAY     VARCHAR2(240)
    PAY     NUMBER
    HEL     NUMBER
    PEO     VARCHAR2(150)
    PER     NUMBER
    PER     VARCHAR2(30)
    PER     NUMBER(15)
    PRO     VARCHAR2(240)
    PRO     VARCHAR2(240)
    QUA     NUMBER(15)
    QUO     NUMBER
    QUO     DATE
    QUO     DATE
    QUO     VARCHAR2(80)
    RED     VARCHAR2(240)
    REP     VARCHAR2(360)
    REP     VARCHAR2(30)
    REP     VARCHAR2(30)
    REP     VARCHAR2(150)
    REP     VARCHAR2(3)
    REP     VARCHAR2(150)
    REP     VARCHAR2(50)
    ROL     VARCHAR2(60)
    SHI     VARCHAR2(360)
    SPL     VARCHAR2(240)
    STA     DATE
    TER     DATE
    TOT     VARCHAR2(240)
    TRX     NUMBER
    TRX     VARCHAR2(240)
    TRX     VARCHAR2(20)
    TRX     VARCHAR2(30)
    WAI     VARCHAR2(240)
    YEA     NUMBER
    MAN     VARCHAR2(30)
    BUF     NUMBER
    BUF     VARCHAR2(60)
    EMC     NUMBER
    EMC     VARCHAR2(60)
    INT     NUMBER
    INT     VARCHAR2(60)
    SUP     NUMBER
    SUP     VARCHAR2(60)
    BRM     NUMBER
    BRM     VARCHAR2(60)
    SUP     NUMBER
    SUP     VARCHAR2(60)
    REP     NUMBER
    REP     VARCHAR2(60)
    DIV     NUMBER
    DIV     VARCHAR2(60)
    SUP     NUMBER
    SUP     VARCHAR2(60)
    REG     NUMBER
    REG     VARCHAR2(60)
    SUP     NUMBER
    SUP     VARCHAR2(60)
    ARE     NUMBER
    ARE     VARCHAR2(60)
    DIS     NUMBER
    DIS     VARCHAR2(60)
    ROL     VARCHAR2(240)
    ACC     NUMBER
    BON     NUMBER
    COM     VARCHAR2(240)
    COM     VARCHAR2(240)
    REP     NUMBER
    BIL     NUMBER
    BAS     NUMBER
    TOT     NUMBER
    TOT     NUMBER
    OVE     NUMBER
    BLP     NUMBER
    QUO     VARCHAR2(30)
    FN_     NUMBER
    FN_     VARCHAR2(10)
    SAL     NUMBER
    RES     NUMBER
    CRE     NUMBER
    MAN     VARCHAR2(100)
    PER     NUMBER
    PLA     NUMBER
    PLA     NUMBER
    REV     VARCHAR2(30)
    REP     VARCHAR2(150)
    OU_     NUMBER
    OU_     NUMBER
    EXC     VARCHAR2(1)
    MAN     NUMBER
    INV     NUMBER
    REP     NUMBER
    UPL     VARCHAR2(1)
    COM     NUMBER
    SEQ     NUMBER
    QUO     NUMBER
    PRO     VARCHAR2(10)
    PRO     NUMBER
    PRO     NUMBER
    BI_     NUMBER
    CUR     NUMBER
    YTD     NUMBER
    PAY     NUMBER
    PAY     DATE
    PAY     VARCHAR2(1000)
    PAY     VARCHAR2(80)
    PAI     VARCHAR2(1)
    HOL     VARCHAR2(1)
    SRP     NUMBER
    WAI     VARCHAR2(1)
    WAI     VARCHAR2(1)
    GBK     VARCHAR2(10)
    TRX     DATE
    PAY     NUMBER(15)
    FIX     NUMBER
    TER     DATE
    ADJ     VARCHAR2(240)
    PAY     NUMBER
    PRO     DATE
    OIC     DATE
    OIC     NUMBER
    OIC     VARCHAR2(30)
    OIC     NUMBER
    HEL     NUMBER
    COM     NUMBER
    TRA     NUMBER
    HDR     VARCHAR2(30)
    LIN     VARCHAR2(30)
    LIN     DATE
    SRC     DATE
    EM_     DATE
    EM_     DATE
    ORD     VARCHAR2(30)
    REP     VARCHAR2(150)
    BIL     VARCHAR2(300)
    PER     VARCHAR2(240)
    Excuse the incomplete column names. All datatypes are basic ones and there are no constraints defined on any of the columns (dw env). The table is partitioned.

  • IDM with SQL server Error: Cannot find columns for the table...

    Hi all,
    I am Configuring IDM with SQL Server repository and ran into this error.
    'Cannot find columns for the table 'object'
    .....jdbc...[SQL Server]Invalid object name 'object'
    Can anybody please help me!!
    G

    Yes, permissions are very important. I ran into a similar problem because I didn't have the correct permissions. Make sure the user has the following permissions:
    CREATE ANY TABLE
    ALTER ANY TABLE
    DROP ANY TABLE
    CREATE ANY PROCEDURE
    EXECUTE ANY PROCEDURE
    DROP ANY PROCEDURE
    Also, make sure there is enough space in the default tablespace of that user.
    HTH
    ~Suvesh

  • Suppressing Columns in Pivot table when adding subtotal

    Hi,
    We have a dimension hierarchy like this:
    Level 1 ---> Level 2 ---> Level 3
    T ---> A ----> B1
    T ---> A ----> B2
    T ---> C ----> D
    T ---> E ----> E
    The report we are trying to build is of this format:
    Row_Num --> Dimension --> Amount
    1 --> B1 ---> 100
    2 --> B2 ---> 50
    3 --> A ---> 150
    4 --> D ---> 75
    5 --> C ---> 75
    6 --> E ---> 100
    When using Pivot table and subtotals, we are getting the report as below: (where for Dimension Value "E" there are two rows)
    Row_Num --> Dimension --> Amount
    1 --> B1 ---> 100
    2 --> B2 ---> 50
    3 --> A Total ---> 150
    4 --> D ---> 75
    5 --> C Total ---> 75
    6 --> E ---> 100
    7 --> E Total ---> 100
    We do not want the subtotals to be calculated if Level 2 and Level 3 are the same.
    Any ideas on how to achieve this?
    Many Thanks,
    Seetharam

    Hi user7276913,
    Are you sure you are using a Pivot Table view? Or are you using the standard table view?
    In a pivot table, you can only have (n-1) sub-totals where n is the number of fields in your "Rows" section. So in your case you have two fields, so you can only have 1 sub-total. See my screen shot below where I have a similar situation:
    !http://i47.tinypic.com/icux5y.png!
    Note that in the screen shot only the first column has a summation and the second does not. This makes sense since a sub-total and the last column would be the same as the values being displayed in the "measures" section.
    What you described in your post seems more like what I'm seeing in a standard table view
    !http://i48.tinypic.com/34z12zp.png!
    Based upon what I'm seeing in your sample report, it seems like you are missing some kind of line item number or transaction number or some field that uniquely determines a row. If you add this field into the pivot table you will get exactly what you want.
    e.g. Pivot Table Rows = Customer # (with summation Enabled) , Document Type (Summation Enable), Line Number
    Good luck and if you found this post useful, please reward points!
    Best regards,
    -Joe

  • How to add column to compressed table

    Hi gurus,
    Can any one help me how to add a column to compressed tables
    Thanks in advance

    The only difference is if added column has default value. In that case:
    SQL> create table tbl(id number,val varchar2(10))
      2  /
    Table created.
    SQL> insert into tbl
      2  select level,lpad('X',10,'X')
      3  from dual
      4  connect by level <= 100000
      5  /
    100000 rows created.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       3145728
    SQL> alter table tbl move compress
      2  /
    Table altered.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       2097152
    SQL> alter table tbl add name varchar2(5) default 'NONE'
      2  /
    alter table tbl add name varchar2(5) default 'NONE'
    ERROR at line 1:
    ORA-39726: unsupported add/drop column operation on compressed tables
    SQL> alter table tbl add name varchar2(5)
      2  /
    Table altered.
    SQL> update tbl set name = 'NONE'
      2  /
    100000 rows updated.
    SQL> commit
      2  /
    Commit complete.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       7340032
    SQL> select compression from user_tables where table_name = 'TBL'
      2  /
    COMPRESS
    ENABLED
    SQL> alter table tbl move compress
      2  /
    Table altered.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       2097152
    SQL> SY.

  • How to add columns for existing table dynamically?

    Hi,
    I created table structure only. I want to add columns for this existing  table. Columns are not fixed, according to the  user choice i  need to write code.
    Plz give me reply asap.
    Thanks
    Shirisha

    Hi Shirisha,
    I think the following code snippet will help you.
    int l_no_cols = 0;
    //Get the number of columns in this variable, something like the following
    //l_no_cols = wdContext().currentContextElement().get<Context_attribute_name>;
    IWDTable l_tab;
    IWDTransparentContainer l_tbl_cont = (IWDTransparentContainer)view.getElement("TableDataCont");//ID of Container
    l_tab = (IWDTable)view.getElement("TableData");//ID of Table
    l_tab.setVisible(WDVisibility.VISIBLE);
    l_tab.bindDataSource(wdContext.nodeTable_Data().getNodeInfo());
    for(int a = 1; a <=l_no_cols; a++)
    //Creating the column
    IWDTableColumn l_tab_col = (IWDTableColumn)view.createElement(IWDTableColumn.class,"COL"+a);
    //Creating Caption for Column Header
    IWDCaption l_tab_cap = (IWDCaption)view.createElement(IWDCaption.class,"Caption"+a);
    l_tab_cap.setText("Col"+i);               
    l_tab_col.setHeader(l_tab_cap);
    //Creating Table Cell Editor for column
    IWDInputField l_tab_cell = (IWDInputField)view.createElement(IWDInputField.class,"CellEditor"+a);
    //creating context node attribute for the column dynamically
    wdContext.nodeTable_Data().getNodeInfo().addAttribute("Col"+i,"com.sap.dictionary.String");
    l_tab_cell.bindValue(wdContext.nodeTable_Data().getNodeInfo().getAttribute("Col"+i));
    l_tab_col.setTableCellEditor(l_tab_cell);
    l_tab.addColumn(l_tab_col);
    l_tbl_cont.addChild(l_tab);
    Regards,
    Alka

  • I need add column in a table

    can someone tell me how can i add a column in a table somewhere in midle, i don't won't this column at the end of table. this table already have about 500 rows. the column i am adding it is null. can someone tell me how can i do that without losing any data.
    i am using oracle 9.2.0.7
    Thanks

    the question is there is a way to do it instead of investagating why and so.... Well, it was for you to investigate actually to ponder on the question if it is worth it.
    Anyway, I did provide you the way you would do it, if you do decide to do it.
    Did you read till the end of the post?

  • How i add Columns to my table ?

    Guys, im not being able to add my columns to the table, can anyone help me ?
    Thanks!
    TableView<String> tv = new TableView<>();
      tv.setVisible(true);
           TableColumn firstNameCol = new TableColumn();
           TableColumn lastNameCol = new TableColumn();
           TableColumn emailCol = new TableColumn();
           tv.getColumns().add(0,firstNameCol);

    Woah! Thanks man! it works greatly but.... Theres just 1 more issue!! i read all the javaDoc and asked help to a friend but we were unable to find a solution, also, im using the "Introduction to javaFX 2 book".
    Im sorry to keep troubling you guys, but it seems javaFX isnt taking off here, and i sometimes think im one of the first in Brasil to starting learning it.
    They teach java in my College, but i think javaFX is a way better "swing/interface" than the one in java. Anyway , the problem im having is : I need get the data from a db , no problem with that, but how can i insert that data? I tried several solutions but none worked.
    Can you help me one more time :D ? Please!!
    thanks a lot guys
    Anyway, heres what the classes are :
    Main Class :
    package voosparaweb;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author André Vinícius Lopes
    public class Voos {
        public static void main(String args[])
         VoosParaWeb v1 = new VoosParaWeb();
         v1.main(args);
         //The Code Below doesnt  work
         v1.testingDataSetTable("1","13:00","Roma");
    }voosParaWeb Class
    package voosparaweb;
    import javafx.application.Application;
    import javafx.collections.ObservableList;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.GridPane;
    import javafx.stage.Stage;
    * @author André
    public class VoosParaWeb extends Application {
      public TableView<Data> t1 = new TableView<Data>();
      public static void main(String[] args) {
        launch(args);
      @Override
      public void start(Stage primaryStage) {
        Group root = new Group();
        GridPane gp = new GridPane();
        root.getChildren().add(gp);
        Scene scene = new Scene(root, 640, 480);
        t1 = tvset();
        setDataTable();
        t1.setVisible(true);
        gp.add(t1, 1, 1);
         //The Code Below work
        // v1.testingDataSetTable("1","13:00","Roma");
        primaryStage.setTitle("Terminals Panel");
        primaryStage.setScene(scene);
        primaryStage.show();
      public TableView<Data> tvset()
        String Person;
        ObservableList<VoosParaWeb> data;
        TableView<Data> tv = new TableView<Data>();
        tv.setVisible(true);
        TableColumn<Data, String> idTc = new TableColumn<Data, String>("ID#");
        idTc.setCellValueFactory(new PropertyValueFactory("id"));
        TableColumn<Data, String> timeTc = new TableColumn<Data, String>("Time");
        timeTc.setCellValueFactory(new PropertyValueFactory("time"));
        TableColumn<Data, String> destinyTc = new TableColumn<Data, String>("Destiny");
        destinyTc.setCellValueFactory(new PropertyValueFactory("destiny"));
        TableColumn flightTc = new TableColumn("Flight");
        TableColumn counterTc = new TableColumn("Counter");
        TableColumn boardingTc = new TableColumn("Boarding");
        TableColumn gateTc = new TableColumn("Gate");
        TableColumn statusTc = new TableColumn("Status");
        tv.getColumns().add(idTc);
        tv.getColumns().add(timeTc);
        tv.getColumns().add(destinyTc);
        tv.getColumns().add(flightTc);
        tv.getColumns().add(counterTc);
        tv.getColumns().add(boardingTc);
        tv.getColumns().add(gateTc);
        tv.getColumns().add(statusTc);
        return tv;
      public void setDataTable()
        t1.getItems().add(new Data("1", "1:15", "Amsterdam"));
      public void testingDataSetTable(String i,String time,String dest)
        t1.getItems().add(new Data(i,time,dest));
        t1.setVisible(true);
      public static class Data {
        private String id;
        private String time;
        private String destiny;
        public Data()
        public Data(String id, String time, String destiny) {
          this.id = id;
          this.time = time;
          this.destiny = destiny;
        public String getId() {
          return id;
        public String getTime() {
          return time;
        public String getDestiny() {
          return destiny;
    }

  • CEWB - add Columns to standard Table control using enhancement

    hi,
    there is a table control in CEWB where i want to add a field from table STPO. Is this possible to add fields to standard tble control. If yes, what is the method? Enhncement or i read somewhere GUIXT. Whats that?
    Any help will be really appreciated.
    I hv got some list of BADIs, but none of them re triggering in the "Component assignment" screen:
    EWB_SELECTION
    CEWB_TSK_MENU_INTERN
    CEWB_TSK_MENU_EXTERN
    CEWB_OPR_MENU_INTERN
    CEWB_OPR_MENU_EXTERN
    CEWB_COM_MENU_INTERN
    CEWB_COM_MENU_EXTERN
    CEWB_CHA_MENU_INTERN
    CEWB_CHA_MENU_EXTERN
    CEWB_MST_MENU_INTERN
    CEWB_MST_MENU_EXTERN
    CEWB_GEN_MENU_INTERN
    CEWB_TSK_UPDATE
    CEWB_TSK_SCREENS
    ags.
    Edited by: ags on Jan 20, 2012 7:11 PM

    hi,
    I am able to do this using SAP GUIXT scripts. But since I am new to this Script would like to get some advice on it like is it best practice to use this technique in such situations? Also how do i make this change universl, like how should i deliver this develoipment to the customer nd other users? what kind of settings need to be done.
    Any hint will be really helpul.
    Thanks in advance.
    Ags.

  • Cannot Add user to CMC Group when they are a member of LDAP group

    On PreProduction Server CMC
    Softerra LDAP browser used to verify user is a member of LDAP group
    User does not show as a member of that group in the CMC
    Cannot add user to LDAP group showing in CMC, the same group shows the member in LDAP browser
    On Production Server CMC
    For kicks I logged into the CMC on Production and I found the user is correctly showing as a member of the Group
    Why doesn't the groups in CMC show what is actually showing in the LDAP browser?

    Hi,
    Check if you have also mapped in both servers the same groups. It might be that there are some groups missing in the Pre-prod.
    Also, try restarting the CMS. I have seen similar issues that are solved after forcing the recreation of the graph.
    If after the restart you still can't see the groups, check the mapping on the LDAP server. It might be that both servers do not use the same attribute mappings.
    Regards,
    Julian

  • Add columns to a table with lob column

    Hi,
    Just a quick question: is there a performance penalty after adding columns to a table with a lob fied? the lob field is now the last column in the table and via via I was told that adding columns will impact badly the IO performance on the table if the lob field isn't anymore the last column. The table is on a Oracle 10.2.0.3 version.
    thanks. regards
    Ivan

    Havent heard of performance degradation specifically due to a LOB column not being the last column in a table (although there are several issues with just having a LOB column in a table).
    You may want to build a test database to test it out. It should be easy to run tests comparing one with the additional column and one the original to prove or refute it. The results would be interesting to learn - please post them up if you intend to test it out.

  • ORA-03113 error occurs when trying to insert record using procedure

    I have a Database Block whose DML Data Target Type is Procedure. I have given the Insert Procedure Name, Insert Procedure Arguments and Insert Procedure ResultSet Columns. The procedure which is used to insert record into the table, resides in the database. The procedure for insert takes Table of records as argument. I am getting FRM-40735: INSERT-PROCEDURE trigger raised unhandled exception ORA-03113).
    This exception does not occur if the Procedure is place under Program Units. But, I want the procedure to be under Database Block. I am working on Oracle Forms 6i.
    Please help me out in resolving this.

    Hello,
    I think you should call the support for this kind of error.
    Francois

  • Add Row in detail table when check box is checked on a master report table

    Hi,
    How could I detect the click on the check box within a Report and then insert a row in a detail table?
    Many thanks for your help
    jko

    Hi Yogesh,
    That is all handled by the cloneRows() function described in that thread.
    In that function, we first insert a new row:
    var wNew = t.insertRow(ri + 1);ri + 1 = current row + 1 and tells javascript where to add the new row (that is, underneath the current one)
    Then, we loop through all of the cells on the current row and copy its cells into the new row:
    var c;
    var newCell;
    var oldCells = w.getElementsByTagName("TD");
    for (c = 0; c &lt; oldCells.length; c++)
      newCell = wNew.insertCell(c);
      newCell.className = oldCells[c].className;
      newCell.innerHTML = oldCells[c].innerHTML;
    }Next, we search for all INPUT items on the new row and clear the values:
    var inputs = wNew.getElementsByTagName("INPUT");
    var j;
    for (j = 0; j < inputs.length; j++)
      inputs[j].value = "";
    }And, finally, we call the updateInputs() function to rename all of the items on the page. Apex expects all items to have unique "f01_nnnn" etc names, adding in a new row upsets this, so we need to reset them:
    function pad(n)
    var s = '0000' + n;
    return s.substr(s.length-4);
    function updateFields(f)
      var fields = document.getElementsByName(f);
      var j;
      if (fields.length > 0)
        for (j = 0; j < fields.length; j++)
          fields[j].id = f + "_" + pad(j+1);
    function updateInputs()
    updateFields("f01");
    updateFields("f02");
    updateFields("f03");
    updateFields("f04");
    }without doing that, the data may get lost when the page is re-rendered.
    This is all called from a new Derived Column on the report. This column's HTML Expression is:
    &lt;a href="#" onclick="javascript:cloneRow(this)"&gt;&lt;img src="#IMAGE_PREFIX#FNDADD11.gif"&gt;&lt;/a&gt;which generates the + symbols which, when clicked, run the cloneRow() function
    Andy

  • Cannot add data to existing table

    Hello All,
    I have a very trivial issue.  I have an existing test table in SQL and I use DBVisualizer client to connect to the server.
    I have only six records in the table that I am testing.  I have a field called "SITE".  Within this field I have the following data:
    Site:
    NYC
    LA
    BOS
    I am trying to import a csv file with 6 row of records, where I have records in there where 'site' = "BOS".
    But when  I try to import, I get the following error:
    "Violation of Unique Key constraint 'ix1_test'. Cannot insert duplicate key in object 'dbo.test'."
    When I try to add the records manually, SQL allows me to add all data into the row, except when I try to add "BOS" into the site field.  Then the error happens.
    What I do not understand is, I imported a previous csv with nine (9) records with multiple rows of records with "BOS" in the site field and had no issues.
    Why is this occurring now?
    Any help would be great!
    Thanks everyone!

    Thanks for the help Dan.  But it seems like I need the SQL admin to make some changes to the table.  What should I tell the SQL Admin to do on my test table?
    Or since this is a test table, and I believe I have full access to it, is there anything I can run not to make those fields part of a unique constraint?
    I can't really make a recommendation without knowing more about the data.  I see that this is a test table, but is the intent to model something in the real world? In the latter case, you might want more than one table (e.g. rooms, devices,
    and device types).  That would allow you to keep an inventory of computer devices and their locations with any number of devices per room.
    If your intent is to just play around inserting and selecting data without regard to data integrity, you can drop the constraint with the command below, assuming you have permissions to do so.
    ALTER TABLE dbo.test DROP CONSTRAINT idx1_test;
    I do have one minor recommendation for your admin about the constraint naming, though.  Although primary key and unique constraints are implemented as a unique index, I suggest a naming convention other than one that suggests an index.  This will
    help avoid confusion with indexes that are used to improve performance rather than ensure data integrity.  For example, you could name this unique constraint something like UQ_test_1 rather than ix1_test.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How to add column comments to table

    at the time of creating the table, how to add the comments t columns.

    Hi,
    I do not see any way in which you can add comment on column while issuing create table command. You can add comment on the column only after the table is created.
    Regards
    Anurag Tibrewal.

Maybe you are looking for