Re: DBMS_REDEFINITION usage
Date: Fri, 28 Oct 2016 15:11:51 -0500
Message-ID: <CAJvnOJaDWZg7eZamuLQUaaoMm96S0ACzFNVxWK-WmC03PXhNUA_at_mail.gmail.com>
After some research, I did figure out how to do this. I use the
col_mapping option in the start_redef_table procedure, something like this:
col_mapping=>'decode(changed_indicator,1,date_added,to_date('12/31/2999','mm/dd/yyyy'))
change_date,date_added date_added,...'
Obviously I had to do a little playing around with string manipulation to
put it in the line properly, but it does work.
On Fri, Oct 28, 2016 at 9:02 AM, Andrew Kerber <andrew.kerber_at_gmail.com>
wrote:
> I cant quite visualize how to do this. I need to use dbms_redefinition to
> add a column to a table. In the process, I want to put a value in the
> column based on a condition.eg, I want to add a column called
> changed_date, and if the changed_indicator column is 1, I want to populate
> the value with date_added, otherwise I want to put a high value in the
> column.
>
> Once the redefinition process is complete, the column will be maintained
> by our software, but I cant quite figure out how to do this on the fly
> without missing the records modified while dbms_redefinition is running.
>
> Has anyone done this? Am I missing something easy here?
>
> --
> Andrew W. Kerber
>
> 'If at first you dont succeed, dont take up skydiving.'
>
-- Andrew W. Kerber 'If at first you dont succeed, dont take up skydiving.' -- http://www.freelists.org/webpage/oracle-lReceived on Fri Oct 28 2016 - 22:11:51 CEST