dynamically create columns of the table...

I have three tables

'DQ_SUMMARY' with column (ATTRIBUTE_NAME, OWNER)
"di_proposition" with a single column (PROP_NAME) and have values (MP, upward, AP)
"dq_parameter" with a single column (PARAMETER) and have values (TOTAL_RECORDS, TOTAL_DEFECT, DQ)



now I want to add the new column in "DQ_SUMMARY" of the combination of the values of table 'di_proposition' & 'dq_parameter '.

that is now "DQ_SUMMARY" have & I want to add the new column name and column (ATTRIBUTE_NAME, OWNER)
MP_TOTAL_DRECORDS, MP_TOTAL_DEFECT, MP_DQ, UP_ (TOTAL_RECORDS...

If they are already present in 'DQ_SUMMARY', create not and if not then create.

& If I add a new value in the table 'di_proposition' & 'dq_parameter', then it also adds columns to the values

I write the code below but further, I'm not able.

pls help me...



create or replace
PROCEDURE DQ_SUMMARY_REPORT
AS

CURSOR cur_user_tab_cols
IS SELECT column_name
Of user_tab_cols
WHERE column_name = 'DQ_SUMMARY ';

CURSOR cur_di_proposition
IS SELECT pro_name
OF di_proposition
WHERE pro_name = 'MPLS;

CURSOR cur_dq_parameter
IS SELECT Parameter_name
OF dq_parameter;



BEGIN

INSERT INTO dq_summary (ATTRIBUTE_NAME, ENTITY_NAME)
SELECT a.ATTRIBUTE_NAME, b.ENTITY_NAME
DI_ATTRIBUTE_MASTER a, DI_ENTITY_MASTER b
WHERE a.entity_id = b.entity_id;

FOR c_prop IN cur_di_proposition
LOOP

FOR c_para IN cur_dq_parameter
LOOP

IF c_prop.pro_name |' _'. c_para.parameter_name




END DQ_SUMMARY_REPORT;
CURSOR cur_user_tab_cols
IS SELECT column_name
FROM user_tab_cols
WHERE column_name = 'DQ_SUMMARY';

change the condition WHERE table_name = 'DQ_SUMMARY ';

Tags: Database

Similar Questions

  • How to dynamically add columns to the table

    Hi all

    I'm new to ADF and need help on sub condition.

    We have created a ViewObject on the EMPLOYEE table that has under columns:

    EMP_ID,

    EMP_NAME,

    DEPARTMENT,

    COST_CENTER,

    BUSINESS_UNIT

    COUNTRY

    GCODE

    We need to create a page in the ADF with employee table to show only below the columns

    EMP_ID,

    EMP_NAME,

    DEPARTMENT,

    COST_CENTER

    Later, if necessary user should be able to add other columns to the page dynamically.

    Can you please advice on how to implement this feature.

    Thank you.

    Kind regards

    Vidya

    Hello.

    There could be a simple solution, which is to use the component PanelCollection.

    Drag ' drop your VO to a page and create a Table with all the attributes.

    For columns that emp_id, emp_name, cost_center, set the Visible property to false.

    Put the PanelCollection component on your page and drag your table inside.

    When you run the page you will see the view menu in the upper left corner of the table above. You can show/hide columns in this menu.

  • Dynamic number of columns in the table

    Hello

    I use JDev 10.1.3.3.0 with ADF. I just want to create a table, with a dynamic number of columns in the table. The background is that a user of my webapplication can create and submit a sql query. Now, I have to show him the results. My idea was, I have save the result in a bean managed (ResultTable), which is stored in the session context and map at my table in my page.

    If I search the Forum and don't get only one useful thread: {: identifier of the thread = 971888}, but I don't exactly understand. What is the CollectionModel? Do I need this?

    I'm trying to report on the following:

    ResultTable
    public class ResultTable {
    
        public static final String SESSION_NAME = "ResultTable";
        private ArrayList<ResultColumn> columnList; 
        private CollectionModel collectionModel;
    
        public ResultTable() {
        }
    
        public ArrayList<ResultColumn> getColumnList() {
            return columnList;
        }
    
        public void setColumnList(ArrayList<ResultColumn> columnList) {
            this.columnList = columnList;
        }
    }
    ResultColumn
    public class ResultColumn {
        
        private ArrayList<ResultRow> rowList;
        private String name;
    
        public ResultColumn() {
        }
    
        public ArrayList<ResultRow> getRowList() {
            return rowList;
        }
    
        public void setRowList(ArrayList<ResultRow> rowList) {
            this.rowList = rowList;
        }
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    }
    ResultTable
    public class ResultRow {
        
        private String value;
    
        public ResultRow() {
        }
    
        public String getValue() {
            return value;
        }
    
        public void setValue(String value) {
            this.value = value;
        }
    }
    My showResult.jspx
    <af:table emptyText="No items were found"
              value="ResultTable.columnList"
              var="column"
              varStatus="colStatus"
              id="table1">
      <af:forEach items="#{column.rowList}" var="row" varStatus="rowStatus">
        <af:column sortable="false" headerText="#{column.name}" 
                   id="column#{colStatus.index}">
          <af:outputText value="#{row.value}"
                         id="outputText#{rowStatus.index}"/>
        </af:column>
      </af:forEach>
    </af:table>
    The ResultTable was filled with data, but the Board is not filled. So, I think, it must be rejected to the data binding.

    I get warnings and errors to run too. But I don't know if they are the result or cause of my problem.
    27.10.2009 10:15:41 oracle.adfinternal.view.faces.renderkit.core.xhtml.TableRenderer renderTableWithoutColumns
    WARNUNG: Table with id: form1:table1 has no visible columns!
    27.10.2009 10:15:41 oracle.adfinternal.view.faces.io.HtmlResponseWriter endElement
    SCHWERWIEGEND: Element End name:span does not match start name:div
    27.10.2009 10:15:41 oracle.adfinternal.view.faces.io.HtmlResponseWriter endElement
    SCHWERWIEGEND: Element End name:span does not match start name:div
    27.10.2009 10:15:41 oracle.adfinternal.view.faces.io.HtmlResponseWriter endElement
    SCHWERWIEGEND: Element End name:form does not match start name:span
    27.10.2009 10:15:41 oracle.adfinternal.view.faces.io.HtmlResponseWriter endElement
    SCHWERWIEGEND: Element End name:body does not match start name:form
    27.10.2009 10:15:41 oracle.adfinternal.view.faces.io.HtmlResponseWriter endElement
    SCHWERWIEGEND: Element End name:html does not match start name:body
    Concerning

    Majo

    Hi Mario,.

    
      
        
          
        
      
    
    

    Note that your JSPX snippet above has serious shortcomings:

  • 'ResultTable.rowList' is not an EL expression, but the value attribute of the af: table must refer to an EL expression
  • Items AF:foreach = "#{row.cellList}"-you don't have to store information about the columns of all rows, more it won't work as af:forEach tag may not see the value of the expression of EL #{line} (or any component EL expression created). " See the tagdoc here: http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/forEach.html
  • "ID =" Column #{cellStatus.index} "and id =" outputText #{rowStatus.index} "are invalid and that they don't compile even as id attributes cannot contain EL expressions.

    .

    I think to solve your problem, you need three things:

  • List of columns (for example the list If you need to store only the names of column or list If you need additional information),.
  • list of lines,
  • a line can be a map (with the name of the column - cell data mapping; card e.g.) or a list (with columns indexed; for examplelist).

    Example with the lines of the map:

    JSPX snippet:

    
      
        
          
        
      
    
    

    The ResultTable bean:

    public class ResultTable {
    
        private List columnList;
        private List> rowList; 
    
        public ResultTable() {
        }
    
        public List getColumnList() {
            return columnList;
        }
    
        public void setColumnList(List columnList) {
            this.columnList = columnList;
        }
    
        public List> getRowList() {
            return rowList;
        }
    
        public void setColumnList(List> rowList) {
            this.rowList= rowList;
        }
    
    }
    

    Type ResultColumn:

    public class ResultColumn {
    
        // additional fields if needed...
        private String name;
    
        public ResultColumn() {
        }
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    }
    

    AF:table display correctly after the initialization of the values in your beans properly filled ResultTalbe (e.g. to fill the list of rank with the lines).

    Hope this helps,
    Patrik

  • How to create a status column in the table

    Hello everyone

    I am trying to create a column of the table status in frontview Panel. I enclose a picture with her to say clearly what I say.plz tell me how to create the active status column in the table.

    I want to show green for safety stock and red for safety stock below.


  • How to check the index, on the number of columns in the table is created

    How to check on the number of columns in the table the index has been created. ??

    OR

    How check index, on the number of columns in the table that it is been created?

    890306 wrote:
    How to check on the number of columns in the table the index has been created. ??

    >

    OR

    How check index, on the number of columns in the table that it is been created?

    query USER_IND_COLUMNS

    SQL> desc user_ind_columns
     Name                            Null?    Type
     ----------------------------------------- -------- ----------------------------
     INDEX_NAME                             VARCHAR2(30)
     TABLE_NAME                             VARCHAR2(30)
     COLUMN_NAME                             VARCHAR2(4000)
     COLUMN_POSITION                        NUMBER
     COLUMN_LENGTH                             NUMBER
     CHAR_LENGTH                             NUMBER
     DESCEND                             VARCHAR2(4)
    

    Handle: 890306
    Status level: Beginner
    Join date: October 8, 2011
    Messages total: 13
    Total Questions: 5 (5 open)

    Why all the question still pending?

    Published by: sb92075 on December 3, 2011 17:21

  • How to remove columns from the table on the master 1-0?

    I have an array of 96 columns with strings. I also have the array of int 96-elemets (mask) with 1 and 0.

    What I want to do is to is to remove (or hide - but I read that it is not possible) all the columns with index corresponding to 0 in the mask table.

    example:

    columns in the table

    1 2 3 4 5

    mask

    0 1 0 0 1

    I want to remove the columns 1, 3 and 4 and leave only 2 and 5 in my table.

    How can I do?

    If I create loop for with i as the index of the column, when I do DeleteTableColumns() columns number decreases, and I get an error of range out of

    Or do I have an option to hide the unnecessary columns (not set their width to 1, it's very ugly-looking)?

    Please help me (())

    Hello rovnyart!

    1. removal of columns in the table:

    I suspect that the reason why you get the out-of-range error is due to fact that in your loop, you delete the columns in the table, you'll eventually end up by referring to a column that no longer exists, because the other columns before it have been deleted. While you remove each column of your table in the loop for example, the column index number will move, because you deleted the other columns in front of her.

    To resolve this, even if you delete a column in your loop, make sure that you take also into account that the index of the column is moved because of the removed columns.

    2 hide columns in table:

    You can use the ATTR_COLUMN_VISIBLE attribute to hide columns in the table:

    http://forums.NI.com/T5/LabWindows-CVI-idea-exchange/add-attr-column-visible-attribute-for-table-Col...

    http://zone.NI.com/reference/en-XX/help/370051Y-01/CVI/uiref/cviattrcolumnvisible_column/

    3 alternatives:

    Note that another alternative would also use a tree instead, control as the tree control also supports the hidable columns:

    http://forums.NI.com/T5/LabWindows-CVI/table-hide-column/TD-p/569773

    Best regards!

    -Johannes

  • Creating indexes for the table

    can someone help me how to create indexes in the table. I m creating own table... I need to select a particular field in the table. So I need to calculate the index position. I use my code like this,

    This will returnthe number of columns in the table.

    Class array

    {

    private int Table_Index()
    {
    for (int x = 0; x)<>
    {
    table_index = x;
    }
    Return table_index;
    }

    }

    MainClass can I get this length of Index

    Table T1;

    int t1 is T1. Table_Index();

    This property returns my length (4) of table column

    Using this index (t1) I HAV to see what position I'm at table now...

    someone help me...

    You can use a listfield, he supports methods to get the selected row and its contents.

  • Query took too much time when adding new column to the table and the index set on this

    I added a new column to the table that contains thousands of records. and created the composite index with three columns (those newly added + two existing column)

    for the specifics. TBL table there are two columns col1, col2

    I added the new column col3 to TBL and created composit index (col1, col2, col3).

    Now for all the records in col3 is NULL. When I choose on this table, it takes too long...

    Any idea what my I do bad., I have check the query plan, it is using the index

    It is solved using collection of statistics using the

    DBMS_STATS. GATHER_TABLE_STATS

    @Top.Gun thanks for your review...

  • Unable to add a new column to the table of the LCD? Option, just usually add it.

    I have a form of LCD with a table in it. Im trying to simply add a new column to the table. The option is there, but the column appear just after clicking Add the column to the left. I selected a column, right click the space > insert > column to the left. But the habit intsert. The object table properties tab shows lines and colum numbers, but they are grey.

    See screenshots:

    http://www.emermed.NET/staging/forums...

    http://www.emermed.NET/staging/forums...

    It is a dynamic array, where a new line can be inserted using a button. Is that the dynamic nature of the question? ID hate to cancel all the flow dynamics and programming just to add a column, and then reapply them all.

    Thank you!

    Hello

    You do not add the columns in the object > palette (screenshot 2) of the Table. I suspect that the problem is that it is not enough on the page (in the content area) to add the column. In the screenshot 1, if you look at the width of the column highlighted from the space to the right of the table, you will see that a column can be added due to restrictions of space.

    Reduce the width of the column highlighted (temporarily), and then add a column. Once added, you can resize the columns to match the width of the page.

    Hope that helps,

    Niall

  • How to find the NULL columns in the table?

    Hello

    Please provide the query to search for null columns in the table. Here, all the rows in the table have same column as null. It will not change.

    Table
    ---------------
    C1 c2 c3 c4
    X C 10
    T D 20

    I want to know that C2 is the nullable column.
    Thanks in advance!

    Kind regards
    Florian...

    A variance more

    create or replace function is_nulled_column(tab varchar2, col varchar2) return varchar2 is
    cnt number:=1;
    begin
      execute immediate 'select count(1) from '||tab||' where '||col||' is not null and rownum=1' into cnt;
      return case when cnt=0 then 'Y' else 'N' end;
    end;
    

    and use:

    select
     c.OWNER,c.TABLE_NAME,c.COLUMN_NAME,c.NULLABLE,is_nulled_column(c.TABLE_NAME,c.COLUMN_NAME) all_nulls
    from all_tab_columns c
    where c.OWNER=user
    and c.TABLE_NAME like '%'
    order by c.OWNER,c.TABLE_NAME,c.COLUMN_ID
    
  • CSS: Pointing out the columns of the Table

    I want to use the border-bottom property to create underscore for the columns of the table. The complexity is when I try to create colspanned 'parent' or 'Super-colonnes' i.e. of the column heads that span 2 or more child/sub-headings heads. I need the underscore to stop a few pixels short of the next column, so that the user can see what child columns are included in the parent. When I tried to add white borders to the left and to the right, that he worked too good, in that not only it has created the space downstairs, he also created the space at the top (or bottom one above). Essentially the vertical borders to sit on top of the horizontal. Anyone can make sense what I said right? Any ideas how to get what I want (elegantly)?

    Thank you.

    Well, it was pretty easy. I just added the border-collapse attrib and set 'split' and now (white) borders left and right do not cut into the bottom border of the cell above.

    http://mysite.Verizon.NET/brentemerson/public/test_page0.html

  • Addictional columns in the TABLE of $ J

    Hello

    I need to store additional columns in the TABLE of $ J.
    The reason is:

    I build summaries on the tables of my target. The target table does not contain the primary key of the source table.
    He is allowed to delete the data on the source table and in this case, the process must recalculate the summaries. The problem is I know that the primary key of the record deleted on the source tables and I can't recognize what summaries I have to recalculate.

    My idea is to use additional columns for a updated key in the ARRAY $ J that would be filled if the record has been deleted.

    Any better idea? How could I add some columns of addition to the TABLE of $ J?

    Thank you
    Marcin

    OK, so,.
    J$ Table is created by the Journal to create the JKM, stage
    By changing some settings, you can add some information set by Oracle.

    You can change 2 things to recover more than the PK.
    -First of all to the JKM, Journal created in step: change the value of the Capture_values parameter to "both."
    --> This will retrieve the rows in table 2 J$ for an update (UU as the old value) and the United Nations as the new value and integer values for Delete and Insert.

    -You must now change the JV$ and JV$ D views in order to group the 2 lines for the updates.

    I think that's what you need, if I understand.

    Brice

  • Select all checkboxes in the column of the table during the 11 G radio button click

    Hello

    I have a table where I inserted a checkbox in the column of the table. I have two outside this table option button, Yes and no. When I select the option button Yes all the boxes in the table to spread and when I select any option button all the boxes should get deselected. As the boxes are inside the columns of the table, we can use setSelected(). How to do this please give ideas.



    Thank you.

    Hi, Maxim,.

    Is your table based on a view object or some bean code?
    If it is based on the view object, the column Boolean checkbox is bound to some transient attribute?

    Have you tried view iteration object rows (if your table bound to viewobject) /POJO(if created list of pojo instances in bean and bound to table) and by setting the Boolean attribute related to the box to true/false on valueChangeListener option button?

    Can you post an example of code to get an idea of your problem?

    Jean Lou

    Published by: Israel Jean Lou on October 24, 2009 04:50

  • Regd select the column in the table area

    Hello

    I have a search page... Have used autocustomization to create... This page will be used to query data from a table and then we must also update two fields of results table and save.

    There is a region of results. I've included the multiselect table option that made me select a column as the first column of the table. Also, including a tableaction and a button upate with whom...

    I need to write a handler for the update now... but do not understand all the slect column...

    Whenever a user clicks on the boxes to select specific records and change the fields and click Update to save, how to write code to check whether the checkbox option has been activated or not?


    Please help me as soon as possible...


    Kind regards
    Preeti

    Hello

    Take a Transient attribute tell 'SelectFlag' in view object and to set the Instance of the view and the view attribute
    for multipleselection in the table.

    Now that the update is click on the button:

    If (PageContext.GetParameter ("Update")! = null)
    {
    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    OAViewObject vo = (OAViewObject) am.findViewObject ("projVO1");
    Line [] row = vo.getAllRowsInRange ();
    Loop through lines
    for (int i = 0; i)<>
    {
    Check if checbox is checked or not
    If (line.getAttribute("SelectFlag").toString().equals("Y"))//means checbox is checked for this line.
    {
    write your logic
    }
    }
    }

    Thank you
    Gerard

  • RollbackToSP will be working if the column in the table has been abandoned?

    Hi all

    I would really appreciate an opinion on these two scenarios in OWM.

    Scenario one

    Steps to follow:



    Savepoint1, created may 20
    DIAL THE DBMS_WM. CreateSavepoint ('LIVE', 'RRR_Test');


    May 21 change us a table with version:


    DBMS_WM EXEC. BEGINDDL ('users');



    -remove unused column

    ALTER table drop column field users_LTS;



    EXEC DBMS_WM.COMMITDDL ('users');



    3 roll back at the point of backup created on 20 may
    DIAL THE DBMS_WM. RollbackToSP ('LIVE ',' RRR_Test);





    End of the scenario



    Question: Will the OWM correctly changes rollback made to the schema of the table USERS?









    Second scenario





    1 Savepoint1 created may 20
    DIAL THE DBMS_WM. CreateSavepoint ('LIVE', 'RRR_Test');



    May 21 change us a table with version:


    DBMS_WM EXEC. BEGINDDL ('users');



    -remove unused column

    ALTER table drop column field users_LTS;



    EXEC DBMS_WM.COMMITDDL ('users');



    3 roll back at the point of backup created on 20 may
    (1) add the domain of the column to the schema

    (2) rollback
    DIAL THE DBMS_WM. RollbackToSP ('LIVE ',' RRR_Test);



    End of the scenario



    Question: given that the pattern is exactly the same as it was originally, this will work?


    Your ideas are welcome.

    Thank you

    Serge

    Published by: sbornow on May 27, 2009 11:29

    Hi Serge,

    When you add the column to the table, it will be added to all versions/workspaces for this table. All of the current versions, as well as all the historical lines, will contain this new column with a null value or the default value.

    None of DBMS_WM restore procedures will be affected by the DDL changes, or a restore will return all DDL changes made since the backup was created. A backup point cannot become invalid. The restoration works on the level of the line, based on the columns of the primary key (which is not editable by the DOF). So the resulting table will have the same lines as he did at the time that the backup point has been created, adjusted for any changes in the column that has been done on the non-primary key columns.

    Kind regards
    Ben

Maybe you are looking for

  • Why after an update my Norton 360 registry cleaning is a registry key not valid?

    This time was the in update for Adobe Reader, but I saw it with some other updates as well. I noticed this problem in my computer after that microsoft has passed to outlool.com. From there, I started to get the registry changes any time I open micros

  • SM30-304 drivers without wireless/WiFi

    I recently had problems to connect my laptop SM30-304 (number PSM30E-0QKJ1-5U) for my home wireless network that uses the PSK security. The router is Netgear and I am running Windows XP Home SP2. The network is visible, but when I try to connect, Win

  • Need XP graphic drivers for Satellite 5200-902

    HelloI need graphics driver for my toshiba satellite 5200-902.Where can I find it?(windows XP)Thank you!Lorenzo Post edited by: LoreViola

  • Update 7 d not pulling assust beam

    When in full auto, CA or 3 custom parameters, emphasis support beam lights but P, Av, Tv or M beam does not occur. It is enabled in C.FnIII Autofocus / Drive menu 11 - AF-beam of shooting assistance. This is the same behavior for internal and an atta

  • The arrow of extension in the notification area (Vista Edition home premium) is missing

    original title: the notification area (Edition Vista Home premium) The arrow of extension in the notification area is missing?, all other icons are there, have tried to check the "Hide inactive icons" in the properties and also tried unchecked, optio