Column reorder incapacity solutions?

Hello,
I have a question regarding the imposibility to modify the order of columns in a table structure.
I want to change the order for administrative purpose, not for users.Tables are big so recreate is to much cost.
I don't think anybody when creating a table, list columns at random. I define the columns in a table in an order that have a meaning, that make it easier to understand and check the structure of the table, an order that make my administrative labor easier. So it would be nice to have the posibility to get back the order of the table structure when table change, columns droped or added... Specially if table have a lot of columns
How can you list the columns of a table in a meaningfull order, not alphabetically, an order that bold the structure of data, where columns that have similitude are together, and not separted by 40 columns definitions. Nor data, the columns definition.
Another point is the use of the gui em, it's dificult because of pagination if columns that are related are far from each others.
I read some articles and i think there is a tendency to minimize a problem that it's not so strightforward.
Sorry for my english, i try my best.
Grettings.

You can always use the DBMS_REDEFINITION package to change the order of columns in a table. Its rather expensive because you're physically moving a lot of data around. An example of online table redefinition.
You can also create views that present the columns in a meaningful order and just refer to those views.
Justin

Similar Messages

  • Cross column radio group solution using dynamically generated HTML

    I am tasked with creating a screen in Apex matching look and feel of an existing application screen; tabular form, multiple column radio buttons to update a single column value (radio group needs to be row oriented, across multiple columns). I could not find a way to use HTMLDB_ITEM.RADIO_GROUP () function for this due to the radio group being column based, great as a row selector but not for use across columns (each button being a column).
    My first thought was to comprise and use checkboxes via HTMLDB_ITEM.CHECKBOX () for the multiple choices (in each column) and HTMLDB_ITEM.HIDDEN() to hold the chosen value, a JavaScript function for “onClick” event to make the checkboxes in one row act like radio buttons in a radio group. I created a simple application to show the concepts of my solutions …
    SQL looks like this:
    select pk_id, -- f01
    object_to_color, -- f02
    HTMLDB_ITEM.CHECKBOX(11, color_choice,
    'onClick="chkboxAction('||pk_id||', document.wwv_flow.f11, ''RED'')"', 'RED') red,
    HTMLDB_ITEM.CHECKBOX(12, color_choice,
    'onClick="chkboxAction('||pk_id||', document.wwv_flow.f12, ''BLUE'')"', 'BLUE') blue,
    HTMLDB_ITEM.CHECKBOX(13, color_choice,
    'onClick="chkboxAction('||pk_id||', document.wwv_flow.f13, ''GREEN'')"', 'GREEN') green,
    color_choice -- f03
    from objects_to_color
    Columns pk_id and color_choice are set as Show off and Display As Hidden. Note that my HTMLDB_ITEM.CHECKBOX items start with id number 11 (f11 – f13) so as not to conflict with the item id’s Apex will generate on it’s own. I could have used HTMLDB_ITEM functions to create all items and had my own PL/Sql update process.
    This creates a tabular presentation with a column for each color choice as a checkbox, shown checked if that color is initially set.
    The JavaScript function chkboxAction() clears the other checkboxes if a color is selected and stores the color in the hidden item db column for use in Apex Submit processing. Sorry the identation get's lost in the post!
    function chkboxAction (id, ckbx, color) {
    // f01 is pk_id (hidden)
    // f11 is RED checkbox
    // f12 is BLUE checkbox
    // f13 is GREEN checkbox
    // f03 db column color_choice for update (hidden)
    var idx;
    // Find row index using pk_id passed in as id argument.
    for (var i=0; i < document.wwv_flow.f01.length; i++) {
    if (document.wwv_flow.f01.value == id) {
    idx = i;
    i = document.wwv_flow.f01.length;
    if (ckbx(idx).checked == true) {
    // Set hidden color_choice column value to be used in update.
    document.wwv_flow.f03(idx).value = color;
    // Uncheck them all, then reset the one chosen.
    document.wwv_flow.f11(idx).checked = false;
    document.wwv_flow.f12(idx).checked = false;
    document.wwv_flow.f13(idx).checked = false;
    ckbx(idx).checked = true;
    } else {
    // Unchecked so clear color_choice column value to be used in update.
    document.wwv_flow.f03(idx).value = '';
    This works well and, as an aside, has an added feature that the color can be “unchosen” by unchecking a checked checkbox and leaving all checkboxes unchecked. This cannot be done with radio buttons unless a radio button is added as “no color”.
    But what if radio buttons must be used, as in my situation? Here is another solution using custom code to dynamically generate radio buttons for a row based radio group rather than using HTMLDB_ITEM.RADIO_GROUP ().
    select pk_id, -- f01
    object_to_color, -- f02
    '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_1" value="RED" '||
    decode(color_choice, 'RED', 'CHECKED', '')||
    ' onClick="rbAction('||pk_id||', ''RED'')">' red,
    '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_2" value="BLUE" '||
    decode(color_choice, 'BLUE', 'CHECKED', '')||
    ' onClick="rbAction('||pk_id||', ''BLUE'')">' blue,
    '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_3" value="GREEN" '||
    decode(color_choice, 'GREEN', 'CHECKED', '')||
    ' onClick="rbAction('||pk_id||', ''GREEN'')">' green,
    color_choice -- f03
    from objects_to_color
    The pk_id column is used here to ensure a unique name and unique id for the items. In practice a custom api should be used to generate items in this way.
    The JavaScript function is actually simpler for radio buttons because the radio group handles the mutually exclusive logic for choosing a color.
    function rbAction (id, color) {
    // f01 is pk_id (hidden)
    // f03 db column color_choice for update (hidden)
    var idx;
    // Find row index using evaluation_question_id.
    for (var i=0; i < document.wwv_flow.f01.length; i++) {
    if (document.wwv_flow.f01.value == id) {
    idx = i;
    i = document.wwv_flow.f01.length;
    // Set hidden result column referenced in update.
    document.wwv_flow.f03(idx).value = color;
    Now the problem is that on update, Apex will be confused by the custom items and try to post updated values to it’s own internal items – which don’t exist. The result is the very frustrating HTTP 404 - File not found error when apex/wwv_flow.accept executes on Submit. So, the trick is to clear the custom items prior to the update with a simple JavaScript function, then the values show again when the page is rerendered, if you are not branching from the page. The Submit button is changed to call the following function:
    function submit () {
    var items = document.getElementsByTagName("INPUT");
    for (i=0; i< items.length; i++) {
    if (items(i).type == "radio") {
    if (items(i).checked == true)
    items(i).checked = false;
    doSubmit('SUBMIT');
    This technique might have general use when using custom items. Comments or improvements on this?
    See Oracle Apex site: workspace SISK01, app OBJECTS_TO_COLOR

    Just the code for formatting.
    Checkboxes to behave like radio group ...
    SQL ...
    select pk_id,              -- f01
           object_to_color,    -- f02
              HTMLDB_ITEM.CHECKBOX(11, color_choice,
                  'onClick="chkboxAction('||pk_id||', document.wwv_flow.f11, ''RED'')"', 'RED') red,
              HTMLDB_ITEM.CHECKBOX(12, color_choice,
                  'onClick="chkboxAction('||pk_id||', document.wwv_flow.f12, ''BLUE'')"', 'BLUE') blue,
              HTMLDB_ITEM.CHECKBOX(13, color_choice,
                  'onClick="chkboxAction('||pk_id||', document.wwv_flow.f13, ''GREEN'')"', 'GREEN') green,
           color_choice  -- f03
    from objects_to_colorJavaScript ...
    function chkboxAction (id, ckbx, color) {
        // f01 is pk_id (hidden)
        // f11 is RED checkbox
        // f12 is BLUE checkbox
        // f13 is GREEN checkbox
        // f03 db column color_choice for update (hidden)
        var idx;
        // Find row index using pk_id passed in as id argument.
        for (var i=0; i < document.wwv_flow.f01.length; i++) {
           if (document.wwv_flow.f01(i).value == id) {
              idx = i;
              i = document.wwv_flow.f01.length;
        if (ckbx(idx).checked == true) {
          //  Set hidden color_choice column value to be used in update.
          document.wwv_flow.f03(idx).value = color;
          // Uncheck them all, then reset the one chosen.
          document.wwv_flow.f11(idx).checked = false;
          document.wwv_flow.f12(idx).checked = false;
          document.wwv_flow.f13(idx).checked = false;
          ckbx(idx).checked = true;
        } else {
          //  Unchecked so clear color_choice column value to be used in update.
          document.wwv_flow.f03(idx).value = '';
    }Radio button solution ...
    SQL ...
    select pk_id,              -- f01
           object_to_color,    -- f02
           '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_1" value="RED" '||
                decode(color_choice, 'RED', 'CHECKED', '')||
                ' onClick="rbAction('||pk_id||', ''RED'')">' red,
           '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_2" value="BLUE" '||
               decode(color_choice, 'BLUE', 'CHECKED', '')||
               ' onClick="rbAction('||pk_id||', ''BLUE'')">' blue,
           '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_3" value="GREEN" '||
               decode(color_choice, 'GREEN', 'CHECKED', '')||
               ' onClick="rbAction('||pk_id||', ''GREEN'')">' green,
           color_choice  -- f03
    from objects_to_colorJavaScript ...
    function rbAction (id, color) {
        // f01 is pk_id (hidden)
        // f03 db column color_choice for update (hidden)
         var idx;
         // Find row index using evaluation_question_id.
        for (var i=0; i < document.wwv_flow.f01.length; i++) {
           if (document.wwv_flow.f01(i).value == id) {
              idx = i;
              i = document.wwv_flow.f01.length;
        //  Set hidden result column referenced in update.
        document.wwv_flow.f03(idx).value = color;
    function submit () {
      // Clears radio buttons to prevent Apex trying to post and causing page error.
      var items = document.getElementsByTagName("INPUT");
      for (i=0; i< items.length; i++) {
        if (items(i).type == "radio") {
          if (items(i).checked == true)
            items(i).checked = false;
      doSubmit('SUBMIT');
    }

  • REUSE_ALV_GRID_DISPLAY, columns reorder when exporting to Excel

    I have a variable column output and am using "cl_alv_table_create=>create_dynamic_table" to create the field-symbol output table with correct number of columns in the exact order of the field catalog.  The field formatting also matches from the dynamic table to the field catalog.
    I call REUSE_ALV_GRID_DISPLAY with the parameter t_outtab  = <dyn_table>.
    When I execute my program, the ALV grid displays correctly in SAP.
    When I export to Excel using &XXL icon from the toolbar, the resulting Excel table has reordered some columns.
    The first columns are highlighted in yellow as though they are key fields and other columns with no background color have been bumped to the end of the row.
    I do not have any key fields defined in the field-catalog. 
    Any suggestions?

    I have a structure in the data dictionary.
    I call REUSE_ALV_FIELDCATALOG_MERGE with that structure.
    There are 150 fields in the structure.
    I loop through the fields the user has picked to include in the report and delete those from the field catalog that are not used.
    I only keep the fields in the field catalog that are being used in the report.
    I then use the reduced field catalog to create the dynamic table so the field catalog matches the output table - field for field.
    The datatypes also match between the dynamic table and the field catalog.  (char, dats, numc)

  • JTree column reorder event?

    Is their any kind of event raised when the columns in a jtree are reordered? Thanks.

    Do you mean in a JTable?
    If you do then you can listen to the table column model.
    If you do mean in a JTree then I'm confused...

  • After launch Interactive viewer,while trying to reorder columns ie selected one column,and applying got NumberFormatException in FireFox16 like java.lang.Number

    Pop Up Box says NumberFormatExceptio:undefined.<br />
    Does this happen on all columns? Or just specific ones?<br />
    Yes,only after seleting column--> Reorder,based on existing columns.<br />
    BIRT Report rptdesign file.<br />
    FireFox 15 and earlier versions it works fine.But FF16 onwards it wont work. <br />
    the report works fine in FireFox15 and earlier versions.But the exception shows in FF16 onwards.<br />
    Is there any HTML5 parser issues.Because FireFox lower versions there is no HTML5 parser related things.Here may be the parser unable to parse the data correctly.Is there any workaround.<br />
    <br />
    FF16,17 <br />
    tried to html5.offmainthread;false but it is not helps.

    Hi David,
    Sorry to understand this Q..difficult...........
    Question:I'm developing the work using BIRT framework to get report data.
    In that if we launch interactive viewer...
    http://www.birt-exchange.org/org/forum/index.php/
    i'm getting PopUp Box says NumberFormatException only in FireFox 16 and 17 like but not earlier.
    IMO,this is causing because of HTML5 . needs to be disable may be helpful.....
    I'm unable to disable HTML5 completely.......how to parser disable in FireFox16..could u plz helpme this work around..!?
    Thanks,
    Vashi

  • Changing TableColumnModel when a column is reordered

    Hi,
    I'm trying to reorder TableColumnModel as the user moves a column. (so TableColumnModel matches the view) I've looked at TableColumnModel.moveColumn(int, int), but because TableColumnModel.moveColumn() sends out TableColumnModelEvent's, it wasn't working. Has anyone done this before? Thank you very much.

    If you change the model when the user moves a column, this seems like it would have the effect of moving the data back to the column the user moved it from. To the user, it would look like the header moved, but the data stayed where it was.
    When I had problems with this, it was because I want to data I was getting programatically from a certain cell to remain constant regardless of how the user moved the columns. The solution (or light finally dawning) was to get the data directly from the model rather than getting it from the table. So rather than calling
    myTable.getValueAt(someRow, someCol)
    I now called
    myTable.getModel().getValueAt(someRow, someCol);
    Hope this helps. If not post again.

  • [Forum FAQ] How do I add an average line to series group on SQL Server Reporting Services column chart?

    Introduction
    In SQL Server Reporting Service (SSRS), you may need an average value on column chart.
    For the above chart, add an average score line to the chart, you can get which student’s score is larger than average score, and which student’s score is less than average score clearly. This document demonstrates how to add an average line to series groups
    on SSRS column chart.
    Solution
    To achieve this requirement, you can add another values to the chart, change the chart type to line chart. Set the value to average value of the series group and set the line to show only once by using expression. Please refer to the link below to see the
    detail steps.
    Click the chart to display the Chart Data pane.
    Add Score field to the Values area.
    Right-click the new inserted Score1 and select Change Chart Type. And then change chart type to line chart in the Select Chart Type window.
    Change the Category Group name to Subject. Here are the screenshot for you reference.
    Right-click the new inserted Score1 and select Series Properties.
    Click the expression button on the right of Value field textbox, type the expression below:
    =Avg(Fields!Score.Value,"Subject"))
    Click Visibility in the left pane, select “Show or hide based on an expression”, and type in the expression below:
    =IIF(Fields!Name.Value="Rancy",FALSE,TRUE)
    Name in the expression is one of the Students. Then only one line chart is be displayed by using this expression.
    Click Legend in the left pane, type Average_Score to the Custom legend text box.
    The report looks like below:
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • Using sqlldr when source data column is 4000 chars

    I'm trying to load some data using sqlldr.
    The table looks like this:
    col1 number(10) primary key
    col2 varchar2(100)
    col3 varchar2(4000)
    col4 varchar2(10)
    col5 varchar2(1)
    ... and some more columns ...
    For current purposes, I only need to load columns col1 through col3. The other columns will be NULL.
    The source text data looks like this (tab-delimited) ...
    col1-text<<<TAB>>>col2-text<<<TAB>>>col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    END-OF-RECORD
    There's nothing special about the source data for col1 and col2.
    But the data for col3 is (usually) much longer than 4000 chars, so I just need to truncate it to fit varchar2(4000), right?
    The control file looks like this ...
    LOAD DATA
    INFILE 'load.dat' "str 'END-OF-RECORD'"
    TRUNCATE
    INTO TABLE my_table
    FIELDS TERMINATED BY "\t"
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    col1 "trim(:col1)",
    col2 "trim(:col2)",
    col3 char(10000) "substr(:col3,1,4000)"
    I made the column 3 specification char(10000) to allow sqlldr to read text longer than 4000 chars.
    And the subsequent directive is meant to truncate it to 4000 chars (to fit in the table column).
    But I get this error ...
    Record 1: Rejected - Error on table COL3.
    ORA-01461: can bind a LONG value only for insert into a LONG column
    The only solution I found was ugly.
    I changed the control file to this ...
    col3 char(4000) "substr(:col3,1,4000)"
    And then I hand-edited (truncated) the source data for column 3 to be shorter than 4000 chars.
    Painful and tedious!
    Is there a way around this difficulty?
    Note: I cannot use a CLOB for col3. There's no option to change the app, so col3 must remain varchar2(4000).

    You can load the data into a staging table with a clob column, then insert into your target table using substr, as demonstated below. I have truncated the data display to save space.
    -- load.dat:
    1     col2-text     col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    END-OF-RECORD-- test.ctl:
    LOAD DATA
    INFILE 'load.dat' "str 'END-OF-RECORD'"
    TRUNCATE
    INTO TABLE staging
    FIELDS TERMINATED BY X'09'
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    col1 "trim(:col1)",
    col2 "trim(:col2)",
    col3 char(10000)
    SCOTT@orcl_11gR2> create table staging
      2    (col1 varchar2(10),
      3       col2 varchar2(100),
      4       col3 clob)
      5  /
    Table created.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test.ctl log=test.log
    SCOTT@orcl_11gR2> select * from staging
      2  /
    COL1
    COL2
    COL3
    1
    col2-text
    col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    1 row selected.
    SCOTT@orcl_11gR2> create table my_table
      2    (col1 varchar2(10) primary key,
      3       col2 varchar2(100),
      4       col3 varchar2(4000),
      5       col4 varchar2(10),
      6       col5 varchar2(1))
      7  /
    Table created.
    SCOTT@orcl_11gR2> insert into my_table (col1, col2, col3)
      2  select col1, col2, substr (col3, 1, 4000) from staging
      3  /
    1 row created.
    SCOTT@orcl_11gR2> select * from my_table
      2  /
    COL1
    COL2
    COL3
    COL4       C
    1
    col2-text
    col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    1 row selected.

  • How to Load file name in to Oracle table column

    hi,
    I am loading data from flat file(TEST_GRET.DMP) to oracle table.
    while the Target Oracle table has four coloumns, in which one is File_name.
    I want to load the FILE NAME into that table too. as there is no ????
    how it can be done???
    Regards,

    If you are loading multiple files using a single interface, using variables, Bhabani's first solution and my solution are good.
    If you only have one interface with your datastore, you know the file name and it won't change, you can use Bhabani's second solution or mine.
    I did not test my solution but it is quite simple to test.
    Just put the code provided for the mapping of your target column.
    This solution has the advantage it should always work.
    Regards

  • Help with divs and columns please?

    Hello all,
    I'm quite new to dreamweaver and having problems. I am
    designing a site with 3 columns (left for nav, middle for main
    content and right for offers & advertising etc.) I am using
    tables within the divs to organise content and I have aligned the
    divs left and in all sorts of other ways to try and get them to
    look like 3 columns but no matter what I do the right column always
    ends up underneath the middle column. What am I doing wrong?
    Thanks in advance

    Faux columns. I don't like javascript solutions.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Jay Jhabrix" <[email protected]> wrote in message
    news:ga92ts$23c$[email protected]..
    > Murray,
    >
    > BTW... am trying to create a 3 column site... staying
    away from tables...
    > :)
    >
    > As i see it i have two choices:
    > 1/ Go for a 'faux column" kind of solution
    > 2/ PVII's javascript driven answer
    >
    > Ideally, i'd like to do it purely in CSS but with
    minimal hacks. I will be
    > using tables but don't want them to be a feature of the
    design... purely
    > for content. Background white. But want to have four
    borders... left,
    > right and the two central ones. Fixed width. Any
    suggestions, links?
    >
    > (One menu is definitely PMM.)
    >
    > Cheers,
    >
    > JJ
    >
    > "Murray *ACE*" <[email protected]>
    wrote in message
    > news:ga920g$tv$[email protected]..
    >>I can take it....
    >>
    >> --
    >> Murray --- ICQ 71997575
    >> Adobe Community Expert
    >> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >> ==================
    >>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >> ==================
    >>
    >>
    >> "Jay Jhabrix" <[email protected]> wrote in
    message
    >> news:ga91so$ph$[email protected]..
    >>> "Murray *ACE*"
    <[email protected]> wrote in message
    >>> news:ga8vu7$rpa$[email protected]..
    >>>
    >>>> Heh - no. It was the perceived status of the
    OP.
    >>>
    >>> That's what i kind of figured... but couldn't
    resist the dig ;->
    >>>
    >>
    >
    >

  • Interactive Report with Null Columns

    I've got a user who wants to export an interactive report, and he needs certain columns to appear on the export for him to fill the data in later (this is an intermediate step, while we work on getting all the data he needs in to the database). I've created the report query, and there are a handful of null/empty columns (to preserve the correct order for the export). When I try to add this query to APEX in an interactive report, I get a "ORA-00001: unique constraint (APEX_040000.WWV_FLOW_WORKSHEET_COLUMNS_UK2) violated" error.
    Googling around shows me that this happens because of similarly-named columns, and the solution is to provide aliases to all columns. My report has aliases on all columns, but I still cannot create an interactive report. I've tried changing the null columns to empty strings, as well as enclosing the aliases in double-quotes, but nothing works. I can however use my original query to create a standard report, but due to the export requirement, this isn't ideal.
    I was able to create the interactive report with one null column, and then edited the report source to add in the others. This had to be done one at a time, since trying to add multiple null columns at the same time gives the same error again. Unfortunately, when I try and run the page, I get an "ORA-20001: get_dbms_sql_cursor error ORA-00918: column ambiguously defined" error.
    My original query:
    select customer.customer_name as customer,
           project.name as project_name,       
           trunc(project.estimated_end_dt) as due_date,
           project_status.project_status_desc as status,
           null as revenue,
           project.baseline_effort as baseline_hours,
           null as projected_cost,
           null as est_gain_loss,
           project.actual_hours as actual_hours,
           project.estimated_hours as projected_hours,
           null as projected_cost,
           null as projected_gain_loss,
           null as roi      
        from project,
             customer
      where customer.customer_id = project.customer_id
      and project.inactive_ind = 0
      and project.customer_id is not null
      and project.estimated_end_dt >= :DTP_P50_STARTDT
      and project.estimated_end_dt <= :DTP_P50_ENDDT
    order by customer.customer_name,
             project.estimated_end_dt;             Can someone tell me a way to create an interactive report with multiple null columns?

    Hi shimmoril,
    The problem is likely that you have two columns aliased as "projected_cost" (7th column and 11th column).
    Hope this helps,
    John
    If you find this information useful, please mark the post "helpful" or "correct" so that others may benefit as well.*

  • Filter column based on another column - OBIEE 11g

    Hi, I have kind of a strange requirement. I'm trying to build a dashboard that lets a user see data for the current day, last week, last month, or last year. I'm going to create a presentation variable called "date_range" where the user can choose one of those 4 options.
    Based on this, I've defined a column in answers with the following formula:
    cast
    case
    when 1 = 0 then "Query Time"."Date"
    when @{date_range}{'Day'} = 'Day' then Current_Date
    when @{date_range}{'Week'} = 'Week' then TIMESTAMPADD(SQL_TSI_DAY, -7, CURRENT_DATE)
    when @{date_range}{'Day'} = 'Month' then TIMESTAMPADD(SQL_TSI_DAY, -30, CURRENT_DATE)
    when @{date_range}{'Day'} = 'Year' then TIMESTAMPADD(SQL_TSI_DAY, -365, CURRENT_DATE)
    else TIMESTAMPADD(SQL_TSI_DAY, -10000, CURRENT_DATE)
    end as DATE
    Based on the 4 presentation variable, this should give the proper "start date" of when to pull data.
    Now I've added the actual date column from the date dimension. But I need to put a filter on the date dimension date column that says it's greater than or equal to the calculated column above. How do I do that?
    Thanks,
    Scott

    I always expect what you're expecting, but you can't filter a column on another column. The solution is just to write one formula that returns a literal, so it will be
    case when (your date column) >= (your long formula) then 'Y' else 'N' end
    Then filter that column on 'Y'.
    Regards,
    Robert

  • How to validate date columns in tabular forms?

    Hi,
    I have two date columns in a tabular form
    1.Start_date 2.End_date so here i need to validate the end_date as should not be lesser value than start_date column
    so any solution for this?

    Hi,
    use a validation of type "Function returning boolean" and the following code:
    IF to_date(:YOUR_END_DATE,'YYYY-MM-DD') < to_date(:YOUR_START_DATE,'YYYY-MM-DD') THEN RETURN FALSE;
    ELSE RETURN TRUE;
    END IF;The date format is of course in your choice.
    Hope this helps...
    Thanks
    Sandro

  • Selective reordering of columns in a Jtable

    Hi
    I have this problem where I need to allow the first 8 columns to be reordered but not the remaining columns in a Jtable.
    I have tried a few approaches by adding listeners to the jtable header and identifying the column which is clicked for reordering and accordingly setting the rearrange policy / feature of the jtable to true/false.
    This works fine in almost all scenarios except for one where the user selects a column which can be reordered and drags it to a position beyond the allowed 8 columns, and now that column is frozen since it is beyond the permissible index of 8.
    I was wondering if there was a 'cleaner'/ better way to go about implementing this.

    Thanks for the link...
    I went through it but seems like a big change for the functionality I want to achieve.
    I am thinking about allowing the user to reorder the column and then if he has chosen an invalid column (one which cannot be rearranged) just undo that action using the moveColumn method.
    I tried overriding the columMoved method to inform me about a column reorder evernt but that method keeps getting fired while the user is rearranging.
    Is there anyway to get a notification once the user is done rearranging the column.
    Thanks

  • Help: Best Solution for Auditing??

    Hi,
    Scenario: We are in the process of implementing a large scale application utilizing BC4J and Struts. Our client has about 100 users on the system daily, they are authenticated at the application tier (username is stored throughout the session in a user object). We will NOT be creating database users for each application user.
    Issue: Our database tables have audit columns to monitor who is performing the data manipulation. Each table has an audit trigger that populates the audit columns, but this obviously is meaningless since everyone is connected to the DB under the same user.
    Our Current Solution: We have disabled our audit triggers, and we are setting the audit columns equal to the application user at the application tier level. This has been tedious to implement since we have 100s of different classes that perform DML that needed additional setAttribute calls for the audit columns.
    Other Solutions???
    Thanks in advance,
    Andy Hamilton
    TUSC

    Hi,
    Below is a reply I have emailed to Matt last week for anyone who are interested.
    Matt,
    I think the best is to implement prepareSession in the root app module
    and do your own authentication in the middle-tier rather than querying
    vo from client. Attached is a copy of app module impl and the login jsp
    I used for the test. If you need the tables or the entire bc4j project
    I used for this test please let me know. I can zip it up and mail it to
    you.
    Let me know if this is a workable solution. I still think a custom JAAS
    login module is the right solution because it doesn't tie to a
    particular business package or application.
    Thanks,
    Yvonne
    Below are the custom application module and LoginPage.jsp I have tested
    package mypackage1;
    import oracle.jbo.server.ApplicationModuleImpl;
    import oracle.jbo.Session;
    import oracle.jbo.ViewObject;
    import oracle.jbo.JboContext;
    import oracle.jbo.JboException;
    import java.util.Hashtable;
    import oracle.jbo.common.PropertyMetadata;
    import oracle.jbo.common.PropertyConstants;
    import oracle.jbo.common.CommonMessageBundle;
    // --- File generated by Oracle Business Components for Java.
    public class Mypackage1ModuleImpl extends ApplicationModuleImpl
    * This is the default constructor (do not remove)
    public Mypackage1ModuleImpl()
    protected void prepareSession(Session session)
    super.prepareSession(session);
    authenticate(session);
    void authenticate(Session session)
    Hashtable env = session.getEnvironment();
    String userName = (String) env.get(JboContext.SECURITY_PRINCIPAL);
    if (userName != null)
    ViewObject usersView = getUsersView1();
    usersView.setWhereClause("USERID = '" + userName + "'" );
    usersView.executeQuery();
    if (usersView.hasNext())
    System.out.println("Authentication Success");
    else
    System.out.println("Authentication Failed");
    throw new JboException(CommonMessageBundle.class,
    CommonMessageBundle.EXC_SECURITY,
    new Object[]{env.get(JboContext.SECURITY_PRINCIPAL)});
    * Container's getter for DepthistoryView1
    public DepthistoryViewImpl getDepthistoryView1()
    return (DepthistoryViewImpl)findViewObject("DepthistoryView1");
    * Container's getter for UsersView1
    public UsersViewImpl getUsersView1()
    return (UsersViewImpl)findViewObject("UsersView1");
    * Sample main for debugging Business Components code using the tester.
    public static void main(String[] args)
    launchTester("mypackage1", "Mypackage1ModuleLocal");
    <%@ page contentType="text/html;charset=windows-1252"
    import="oracle.jbo.http.HttpContainer,oracle.jbo.JboContext"
    %>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>Login</TITLE>
    </HEAD>
    <BODY>
    <%
    // If this is a post request then assume that it is the result
    // of a form submit. Attempt to login.
    if (request.getMethod().equalsIgnoreCase("POST"))
    // Invalidate any previous "am" application SessionCookie
    // which may exist for this session.
    HttpContainer c = HttpContainer.getInstanceFromSession(session);
    c.setSessionCookie("am", null);
    // Cache the principal and credentials in the session.
    session.setAttribute(JboContext.SECURITY_PRINCIPAL, request.getParameter("username"));
    session.setAttribute(JboContext.SECURITY_CREDENTIALS, request.getParameter("password"));
    try
    %>
    <!-- Use the ApplicationModule tag to force a connection attempt. -->
    <jbo:ApplicationModule
    id="am"
    configname="mypackage1.Mypackage1Module.Mypackage1ModuleLocal"
    releasemode="Stateful" />
    <!-- Immediately release the application module so that the release
    mode of this page does not interfere with the release mode of the
    page to which we are forwarding. The session cookie will remain
    authenticated, and since we are using pooling it should not consume
    significant CPU cycles in reacquiring an ApplicationModule instance.
    Stateful is also preferred because it does not incur additional
    cycles to reset the ApplicationModule state between this page and
    the page to which we are forwarding. -->
    <jbo:ReleasePageResources appid="am" />
    // If login is successful, then forward to the application entry point.
    <jsp:forward page="DepthistoryView1_Browse.jsp" />
    <%
    catch (oracle.jbo.JboException e)
    // If login fails, then invalidate the session cookie that was
    // implicitly created by the ApplicationModule tag above.
    c.setSessionCookie("am", null);
    %>
    <h2>Login Failed. Please Try Again.</h2>
    <%
    %>
    <table width="300" border="0" cellspacing="2" cellpadding="2">
    <form method="post" action="LoginPage.jsp" name="Login">
    <tr>
    <td align=right valign="middle"><span>Username  </span>
    </td>
    <td align=left valign="top" colspan="2">
    <input name="username" size=15 maxlength="100"> </td>
    </tr>
    <tr>
    <td align=right valign="middle"><span>Password  </span> </td>
    <td align=left valign="top">
    <input type=password name="password" size=15 maxlength="100"> </td>
    <td align="left" valign="middle" width="15%">
    <input type="submit" value="Login">
    </td>
    </tr>
    </form>
    </table>
    </BODY>
    </HTML>

Maybe you are looking for