Column addition between columns rather add to last

Can oracle support column addition in between two columns rather adding a column

Not easily, no. And 99.9% of the time, it's a really bad idea to try-- you're much better off accessing the data through a view where it is trivial to present columns in whatever order you'd like.
If you really need to, you could use the DBMS_REDEFINITION package but under the covers, that's really just creating a new table with the new column order and copying the data over. It just does that without downtime (though it is slower than just creating a new table and copying the data over).
Justin

Similar Messages

  • Add additional flexfields columns ?

    Is it possible to add additional DFF columns to a table. We need to extend that RA_SITE_USES table which is an oracle shipped table. I am aware that it is against the standards but apart from that is it possible to do it.
    I added an additional attribute26 column and in the DFF form when i try to select the column , I do not see the newly added one, is there anything else I need to do .
    thanks,
    Message was edited by:
    user552775
    Message was edited by:
    user552775

    Okay,
    Rule #1: Don't create modifications unless you really have to.
    Rule #2: See Rule #1
    Some other people might have more input here too...
    First, it might be easier to revisit your existing DFF fields and make better use of them - e.g.
    - any that are not user enterable or displayed, push to unused fields e.g. global_attributeXX
    - ensure context sensitivity is being used to make best use of available segments.
    - combine any related DFFs into one (often in combination with validation sets)
    - move any DFFs that are at a lower level of detail to the correct level of detail, eg. if it can be on the customer site rather than customer site use level, move it!
    Some updates to DFF fields may be necessary, but much easier than modifications.
    Second, in response to your question, I've seen it done, but haven't done it myself. Steps would be something like:
    1. Add attributeXX column to base table
    2. Add column to view(s) on top of table
    3. Register the DFF segment
    4. Modify DML handler to add new column
    5. (Possibly but hopefully not - depending on implementation of the UI) Modify UI code to handle new column
    6. Worry about patches/upgrades wiping out your modification.
    Third, You may be able to register another (unused) field on the ra_site_uses table to be used as a DFF field, but not a great idea, as Oracle could use the field without warning.
    (Under Application Developer, Flexfield > Descriptive > Register)
    Fourth, You could extend the UI to include your own fields - extension or modification but you control it more.
    Gareth
    http://garethroberts.blogspot.com

  • Query to add a column in between existing cols of a table?

    HI All,
    I have two questions.
    1. Query to add a column in between existing cols of a table? (not at the end. This is view of an order of output fields in a report)
    2. How do I swap the contents of two columns in a table. Suppose in a table tab there are 2 cols , col1,col2 populated with some data.
    I need a query(probably) to swap the col1 and col2 values . NOT AS A RESULT SET, BUT IT NEEDS TO GET CHANGED IN THE TABLE.
    Please help !

    > 1. Query to add a column in between existing cols of
    a table? (not at the end. This is view of an order of
    output fields in a report)
    Not really sensible ito DBMS - it does not care how you want to view the data. The sequence and formats of columns are what you/the application need to specify in the SQL's projection clause.
    Also keep in mind to achieve this, the DBMS will need to rewrite the entire table to fit this new column in-between existing columns. This is not the best of ideas.
    The projection of rows is dealt with SQL statements - not with the physical storage implementation.
    > 2. How do I swap the contents of two columns in a
    table. Suppose in a table tab there are 2 cols ,
    col1,col2 populated with some data.
    I need a query(probably) to swap the col1 and col2
    values . NOT AS A RESULT SET, BUT IT NEEDS TO GET
    CHANGED IN THE TABLE.
    This seems to work:
    SQL> create table foo_tab( c1 varchar2(10), c2 varchar2(10) );
    Table created.
    SQL> insert into foo_tab select TO_CHAR(rownum), TO_CHAR(object_id) from user_objects where rownum < 11;
    10 rows created.
    SQL> commit;
    Commit complete.
    SQL> select * from foo_tab;
    C1 C2
    1 55816
    2 55817
    3 55818
    4 55721
    5 105357
    6 105358
    7 105359
    8 105360
    9 105361
    10 60222
    10 rows selected.
    SQL> update foo_tab set c1=c2, c2=c1;
    10 rows updated.
    SQL> select * from foo_tab;
    C1 C2
    55816 1
    55817 2
    55818 3
    55721 4
    105357 5
    105358 6
    105359 7
    105360 8
    105361 9
    60222 10
    10 rows selected.
    SQL>

  • How to add a new column in between two other columns

    I need to add a new column in between two other existing columns. Does anyone know how to do that? The ALTER statement adds the column at the end. Can someone give an example.
    Thanks
    Murali
    null

    There is no simpler way of doing this because it is not strictly necessary: you can always see your data in the order you want simply by going SELECT col1, col2, col98, col4, etc. Thus the column order only matters when you execute SELECT * FROM...
    If that really is important enough to you you'll have to drop and re-create the table, for which there are a number of different strategies.
    Your final comment suggests that you don't retain your database build scripts. If you did then rebuilding your constraints would be painless. There is a lesson there. The good news is that if you have TOAD (download from www.quest.com) you can generate DDL scripts from your existing schema.
    HTH, APC

  • How to add some text between columns in dashboard prompt?

    Hi,
    OBIEE version:10.1.3.4.1
    Can we add some words between columns in dashboard prompt?
    like, I want to add OR, make sure user not to select different month, if selected the different months it will make the report no data.
    Month OR Date Range(this is a calendar)
    Does anyone have any idea about this?
    Thanks in advance!
    Regards,
    Anne

    Hi,
    If you are using the prompts with presentation variables or referring only the columns separately then you can create individual prompts and place static text between them.
    But if you need to have both the prompt columns together then create the prompts and use 'space' as the label names for both.(ie prompts would appear but the name wont appear). And create a static text in the page or in a report and place in the page. Which appears as the name of the prompt with 'OR' between the prompt names.
    This should solve your problem.
    Edited by: MuRam on Jan 13, 2012 10:18 AM

  • Simple calculations of two columns (addition, subtraction, ...)

    Hi,
    I'm a job starter and working with Oralce Discoverer 10gR2 for the first time. I want to create a simple report. So I imported a view that looks like this:
    create or replace view v_report_inventories_bc_group as
    select a.the_date,
    a.entity,
    sum(a.histor_statutory_value) as histor_statutory_value
    from t_r2_facts a
    group by a.entity, a.the_date
    now I've generated a cross tab that looks like this:
    31.12.07 31.01.08 29.02.08 31.03.08
    group 100 200 300 400
    company1 70 150 200 300
    company2 30 50 100 100
    The problem is to show the simple difference between the last to months. Furthermore there are other calculations...
    How should I achieve this?
    Any advice would be very appreciate!
    Regards,
    Steffen

    Hi,
    If I'm understanding your question correctly...
    When you brought this view into the Admin Edition it should have asked you if you wanted to use the Default Date Hierarchy. Assuming you did there should be a value called the_date Month under the items in this folder within Desktop/Plus. You would want to add that item in to the top portion of your crosstab and it will then break out the data by month.
    To Subtract Column A from Column B you would create a calculation. The below link has a section called "How to create calculations" which should be of assistance.
    Thanks,
    Jeff
    http://download.oracle.com/docs/html/B13915_04/calculations.htm#i1012748
    Message was edited by:
    Jeff Hohman

  • Additional Lead Column in Report painter

    Hi Gurus
    Please guide me how to add an additional Lead column in Report painter
    Thanks
    Hiren

    Hi HIren,
    There can be only one lead column in report painter.
    However within the one lead column you can identify more than one characteristic - e.g. cost center and cost element. You can then identify that both characteristics should be exploded.
    If you go Edit > Rows > Explode, you have the opportunity of identifying which characteristic takes presidence over the other, and how they expand. So in this example, Cost center will be 1 and cost element will be 2.
    The output will be dependant upon your report layout, but you should have the layout so that you have:
    Cost Center A:
    - Cost Element A
    - Cost Element B:
    - Cost Element C:
    Cost Center B:
    - Cost Element A:
    - Cost Element B:
    - Cost Element C:
    And to distinguish the cost centers from the cost elements, you can format the cost center row "Color for Totals"
    Regards,
    Gaurav

  • XML Report - Conditionally showing a column in between other columns

    I have a XML Report, with columns
    A, B, C, D
    Now I need to add a new column E in between B and C when certain condition is satisfied.
    A, B, E, C, D
    for column E, I kept <?if:column='X'?> columnname <?endif?>.
    When condition is satisfied it is displaying column and also values, but when not an empty column is displayed with no values, I dont want this empty column when condition is not satisfied.
    It should just show A, B, C, D instead of A, B,  , C, D
    Request you to help me with my requirement.

    Hi Kavipriya, thanks for response.
    I tried below condition for that column:
    <?if@column:OM_Due_Date_X='Y'?>  <?OM_Due_Date_L?>  <?end if?> 
    I am setting OM_Due_Date_X in sql package to 'Y' if customer is 'Rob' else it will be 'N'.
    If 'Y', then I am displaying a column name OM Due Date which is <"OM_Due_Date_L?>
    Now for Column values it is just <?OM_Due_Date?>
    Do I need to change anything here ?

  • Additional output column for transaction IW37N.

    Hi All,
    I need to add an additional output column for purchase order in the output of transaction IW37N. I checked the user exit IWOC0004. But it is used only for IW37N.  I found that the following BADIs are present for IW37N:
    1. BADI_EAM_SINGLELEVEL_LIST
    2. IWOC_LIST_TUNING
    3. IHREP_EXTENSIONS
    4. ALV_SWITCH_GRID_LIST
    Could you please let me know if any of the exit/BADI can be used to add the addiional column to the transaction IW37N. I do not want to create a new Z program for this requirement.
    Thanks in advance.
    Regards,
    Suchitra.

    Hi Gautham,
    Thanks for the reply. But I also need to fill the value of the purchase order based on the ATB. Can this also be done through the BADI BADI_EAM_SINGLELEVEL_LIST or we cneed to finc some other exit / BADI?
    Thanks.
    Regards,
    Suchitra.

  • Better approach for checking column values between two different rows

    My requirement is to find best Approach to find difference between column values of two different rows.Below I've mentioned two different
    approaches I'm thinking of,but I'd like to know is there any other better approach.
    version details
    SQL> SELECT *
      2  FROM V$VERSION;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionTable creation script
    CREATE TABLE R_DUMMY
       (CA_ID VARCHAR2(16) NOT NULL ENABLE,
         CA_VER_NUM NUMBER(4,2) NOT NULL ENABLE,
         BRWR_SHORT_NAME VARCHAR2(25 CHAR),
         sic_code     number,
         FAC_ID VARCHAR2(10) NOT NULL ENABLE
    / insert script
    insert into r_dummy (CA_ID, CA_VER_NUM, BRWR_SHORT_NAME, sic_code, FAC_ID)
    values ('CA2001/11/0002', 2.00, 'Nandu',1234, 'FA000008');
    insert into r_dummy (CA_ID, CA_VER_NUM, BRWR_SHORT_NAME, sic_code, FAC_ID)
    values ('CA2001/11/0002', 3.00, 'SHIJU',456, 'FA000008');Desired O/P :
    ca_id               fac_id          column_name          previous name          after_modification
    CA2001/11/0002          FA000008     BRWR_SHORT_NAME          Nandu               SHIJU
    CA2001/11/0002          FA000008     sic_code          1234               456My approach
    select      ca_id,fac_id,column_name,
         decode(column_name,'BRWR_SHORT_NAME',lg_brwr,lg_sic) previous_name ,
         decode(column_name,'BRWR_SHORT_NAME',ld_brwr,ld_sic) after_modification
    from
         select
                   case
                        when ld_brwr != lg_brwr then
                        'BRWR_SHORT_NAME'
                        when ld_brwr != lg_brwr then
                        'sic_code'
                   end
              ) column_name,ca_id,fac_id,lg_brwr,ld_brwr,ld_sic,lg_sic
         from     (
              select ca_id,fac_id,lag_brwr,ld_brwr,ld_sic,lag_sic
              from
                        Select      lead(brwr_short_name,1) over(partition by ca_id,fac_id) ld_brwr,
                             lag(brwr_short_name,1) over(partition by ca_id,fac_id) lg_brwr,
                             lead(sic_code,1) over(partition by ca_id,fac_id) ld_sic,
                             lag(sic_code,1) over(partition by ca_id,fac_id) lg_sic,
                             ca_id,fac_id
                        from r_dummy
              where (ld_brwr != lg_brwr or ld_sic != lg_sic)
    )2nd Approach :
    =============
    select      ca_id,fac_id,column_name,
         decode(column_name,'BRWR_SHORT_NAME',lg_brwr,lg_sic) previous_name ,
         decode(column_name,'BRWR_SHORT_NAME',ld_brwr,ld_sic) after_modification
    from
         select
                   case
                        when ld_brwr != lg_brwr then
                        'BRWR_SHORT_NAME'
                        when ld_brwr != lg_brwr then
                        'sic_code'
                   end
              ) column_name,ca_id,fac_id,lg_brwr,ld_brwr,ld_sic,lg_sic
         from     (
              select ca_id,fac_id,brwr_short_name,sic_code
              from
                        Select      ca_id,fac_id,brwr_short_name lg_brwr,sic_code lg_sic
                        from     r_dummy
                        where     ca_ver_num = '2.00'
                   )o,(
                        Select      ca_id,fac_id,brwr_short_name ld_brwr,sic_code ld_sic
                        from     r_dummy
                        where     ca_ver_num = '3.00'
                              )n
              where      0.ca_id = n.ca_id
                   and 0.fac_id = n.fac_id
                   and (ld_brwr != lg_brwr or ld_sic != lg_sic)
    )Hi Experts,
         I've provided sample data where I'm checking for just two columns viz brwr_short_name ,sic_code,but in real time
    I've to check for 8 more columns so please suggest me with a better approach.
    I appreciate your precious suggestions.

    Hi,
    Thanks for posting the CREATE TABLE and INSERT statements; that really helps!
    Here's one wa. Like your 2nd approach, this uses a self-join:
    WITH     got_r_num     AS
         SELECT  ca_id
         ,     ROW_NUMBER () OVER ( PARTITION BY  ca_id
                                   ,                    fac_id
                             ORDER BY        ca_ver_num
                                 )    AS r_num
         ,     brwr_short_name
         ,     TO_CHAR (sic_code)     AS sic_code
         ,     fac_id
    --     ,     ...     -- Other columns (using TO_CHAR if needed)
         FROM     r_dummy
    ,     unpivoted_data     AS
         SELECT     *
         FROM     got_r_num
         UNPIVOT     INCLUDE NULLS
              (    txt
              FOR  column_name IN ( brwr_short_name          AS 'BRWR_SHORT_NAME'
                            , sic_code               AS 'SIC_CODE'
    --                        , ...     -- Other columns
    SELECT       p.ca_id
    ,       p.fac_id
    ,       p.column_name
    ,       p.txt          AS previous_name
    ,       a.txt          AS after_modification
    FROM       unpivoted_data   p
    JOIN       unpivoted_data   a  ON  p.ca_id     = a.ca_id
                           AND p.fac_id     = a.fac_id
                         AND p.column_name     = a.column_name
                         AND p.r_num      = a.r_num - 1
                         AND p.txt || 'X' != a.txt || 'X'
    ORDER BY  a.r_num
    ;To include other columns, add them in the 2 places where I put the comment "Other columns".
    Ca_ver_num can have any values, not just 2.00 and 3.00.
    This will show cases where a value in one of the columns changed to NULL, or where NULL changed to a value.
    There ought to be a way to do this without a separate sub-query like got_r_num. According to the SQL Language manual, you can put expressions in the UPIVOT ... IN list, but when I tried
    ...     UNPIVOT     INCLUDE NULLS
              (    txt
              FOR  column_name IN ( brwr_short_name          AS 'BRWR_SHORT_NAME'
                                 , TO_CHAR (sic_code)     AS 'SIC_CODE'
              )I got the error "ORA_00917: missing comma" right after TO_CHAR. Perhaps someone else can show how to eliminate one of the sub-queries.

  • How to make paragraphs line up between columns?

    I want to make a 2 column chapter, with the text in each column in its own flow. But then I want some of the paragraphs to line up between columns.
    So, like this:
    xxxxxxxxxx yyyyyyyyy
    xxxxxxxxxx yyyyyyyyy
    xxxxxxxxxx yyyyyyyyy
    yyyyyyyyy
    yyyyyyyyy
    xxxxxxxxxx
    xxxxxxxxxx
    xxxxxxxxxx
    xxxxxxxxxx yyyyyyyyy
    xxxxxxxxxx yyyyyyyyy
    I'm assuming I can't use side heads to put the first column text in, because the info on the left goes on for multiple paragraphs, and I can't seem to line up a block of paragraphs with the baseline of the appropriate right column text.
    I used to do this in tables, like this:
    xxxxxxxxxx ! yyyyyyyyy
    xxxxxxxxxx ! yyyyyyyyy
    xxxxxxxxxx ! yyyyyyyyy
    ! yyyyyyyyy
    ! yyyyyyyyy
    xxxxxxxxxx !
    xxxxxxxxxx !
    xxxxxxxxxx !
    xxxxxxxxxx ! yyyyyyyyy
    xxxxxxxxxx ! yyyyyyyyy
    ...where the gridlines between rows and columns would be hidden. However, I sometimes need to print just the right column, which meant I had to remove the table. It's a 600-page document, I was looking for a more elegant solution.
    Any suggestions?
    I am using FM8.0(266) on Windows XP.

    If you take the sidehead approach that Niels suggest, you could do
    this, but it would be a bit of maintenance.
    Have your "xxxxx" flow content sit in text frames within anchored
    frames. The anchored frames are then in a special conditionalized
    paragraph ("z") in the *sidehead* before every "yyyy" flow section,
    e.g.
    z
    xxxxxxxxxx yyyyyyyyy
    xxxxxxxxxx yyyyyyyyy
    xxxxxxxxxx yyyyyyyyy
    yyyyyyyyy
    yyyyyyyyy
    z
    xxxxxxxxxx
    xxxxxxxxxx
    xxxxxxxxxx
    z
    xxxxxxxxxx yyyyyyyyy
    xxxxxxxxxx yyyyyyyyy
    The "z" paragraph is just a container for the anchored frames and
    should contain no text.
    When you hide the "z" tags, all of the "x" flow content will then
    disappear as well. You'll have to manually customize the height of
    each anchored frame/text frame pair though.
    To adjust the spacings between the "y" flow to match at the bottom of
    the anchored frames for the "x" flows, use the sidehead paratag ("Z")
    and create space above overrides in this paragraph only to adjust the
    vertical spacing to keep the x and y sections in sync. This way, you
    have overrides confined to only one paratag.
    To make maintenance easier, it might be worth creating a FrameScript
    that would adjust the height of the anchored/text frame combo based
    upon the amount of content in the instructor flow and then apply the
    space above override to the anchoring paratag (z).

  • I recently began using reminders in ical and downloaded the iPhone and iPad app. It works great. However, the reminders in ical on the COMPUTER is difficult to work with - thin long column on the right rather than in it's own screen. is there a reminders

    I recently began using reminders in ical and downloaded the iPhone and iPad app. It works great. However, the reminders in ical on the COMPUTER is difficult to work with - thin long column on the right rather than in it's own screen. is there a reminders app for the COMPUTER that is more user friendly?

    sgreenie,
    If you are willing to wait, Apple - OS X Mountain Lion - Inspired by iPad. Made for the Mac explains that a "Reminders" application will be included in the next release of OS X.

  • How to add one date column and charecter column

    hi all,
    i have 3 column start_date(date),end_date( date),duration (varchar2)
    i am trying to add start_time and duration like this
    end_date := to_char(start_time) + duration;
    but its showing value_error
    how to add one date column and charecter column.
    Thanks

    you need something that does:
    end_date (DATE) := start_date (DATE) + <number of
    days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
    e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
      2  -- END OF TEST DATA
      3  select start_dt + duration_days
      4* from t
    SQL> /
    START_DT+
    04-JUL-07

  • How to provide space between columns in alv_grid_display?

    hi,
    gurus,
    I want to provide space between columns in alv display how can i achieve that.
    ex.
    sno   name   street    
    thank u ,
    shabeer ahmed.

    Hi..,
      There you wl get column seperators with seperate blocks and cells in the grid anyway.
    Maintain gap between columns is nothing but grid breaking, its may be possible with oops concept.
    Let me know whats your requirement?
    Thanks,
    Naveen.I

  • How can i remove the line between columns?

    I'm laying out poetry and I only want one column--even in landscape mode. But in landscape mode there's still the line between columns that cuts through my text. I've tried dragging the line, clicking on it and deleting it. When I click on it two Xes appear on the top and bottom, but they don't appear to do anything.

    I did a little more reading of threads and now I understand the approach.
    Go to View/Layouts and click on any of the layouts which appear on the left. At that point you will have access to the full page template and may make any and all changes you wish.
    Keep in mind that some elements will be locked requiring an Arrange/Unlock command before you can eliminat them.
    In the end it will be very easy to create completely customized layouts, including background images, rules, etc. etc.
    Good luck with the poetry.

Maybe you are looking for

  • What is wrong with my Photoshop CS3 extended?

    Hello. I don't understand what's wrong with my CS3 extended, but i don't have Render filters under Filter menu. Have everything else but no Render. Anybody ever had same problem? thank you

  • Problem with ALV : fieldcatlog

    Hi, I am trying to use 'REUSE_ALV_GRID_DISPLAY' to display  a simple ITAB. For some reason, its giving a runtime error. Pls help me to indentify the problem. Am enclosing the code over here. Thanks in advance Hrishi *& Report  ZTEST3 REPORT  ZTEST3 l

  • File Sizes re HD Capacity

    How can I check on file sizes? The HD on my 80gb Macbook shows only 1006 mb free space. A month ago it had almost 50 GB free and I am trying to figure out where this bloat came from. Is there a way I can review the sizes of files without opening each

  • How can i correct my ipad from hanging and not going out to get mail in g mail

    i need to restart my ipad to resolve the situtation. this is a new issue. how can i correct the situation.

  • 10g DatabaseControl Install Failure

    Please Assist: My 10 DatabaseControl Repository creation was successful. And now, my emca -config dbcontrol db ... causes this err: Oct 23, 2008 4:28:29 PM oracle.sysman.emcp.util.FileUtil setAttributeInXML SEVERE: Error parsing XML file C:\oracle\pr