DBMS_REDEFINITION columns and timestamp?

Hello world
I m trying to change a timestamp, timestamp with time zone (local) column using the dbms_redefinition (10.2.0.4) package
Unfortunately I m receiving "ORA-42016: form of the temp table is not specified column mapping" when executing dbms_redefinition.start_redef_table.
I ve also tried to use the to_timestamp_tz within the column mapping section.
I forget some of the details or isn´t can be done this way?

Thanks for all the ideas,
Peter
SQL> desc t1
 Name                                Null?    Type
 ----------------------------------- -------- ------------------------
 ID                                  NOT NULL NUMBER
 TS                                           TIMESTAMP(6)

SQL> desc t2
 Name                                Null?    Type
 ----------------------------------- -------- ------------------------
 ID                                  NOT NULL NUMBER
 TS                                           TIMESTAMP(6) WITH TIME Z
                                              ONE


SQL> exec dbms_redefinition.start_redef_table(uname=>'xxx',orig_table=>'T1',int_table=>'T2',options_flag=>dbms_redefinition.cons_use_pk);
BEGIN dbms_redefinition.start_redef_table(uname=>'xxx',orig_table=>'T1',int_table=>'T2',options_flag=>dbms_redefinition.cons_use_pk); END;

*
ERROR at line 1:
ORA-42016: shape of interim table does not match specified column
mapping
ORA-06512: at "SYS.DBMS_REDEFINITION", line 50
ORA-06512: at "SYS.DBMS_REDEFINITION", line 1343
ORA-06512: at line 1

It seems that there is restriction of use TO_TIMESTAMP (_TZ) directly in the package of redefinition.

Well, here is a workaround:

SQL> create table sysadm.t1(id number primary key, ts timestamp(6));

Table created.

SQL> insert into sysadm.t1 values (1,systimestamp);

1 row created.

SQL> select * from sysadm.t1;

        ID
----------
TS
---------------------------------------------------------------------------
         1
06-OCT-08 02.30.18.873500 PM

SQL> desc sysadm.t1
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                        NOT NULL NUMBER
 TS                                                 TIMESTAMP(6)

SQL> create table sysadm.t2(id number primary key, ts timestamp(6) with time zone);

Table created.

SQL> desc sysadm.t2
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                        NOT NULL NUMBER
 TS                                                 TIMESTAMP(6) WITH TIME ZONE

SQL> create or replace function sysadm.my_to_timestamp_tz(p_timestamp timestamp) return timestamp with time zone is
  2  begin
  3      return to_timestamp_tz(p_timestamp);
  4  end;
  5  /

Function created.

SQL>
SQL> exec dbms_redefinition.start_redef_table('SYSADM','T1','T2','id, my_to_timestamp_tz(ts) ts',dbms_redefinition.cons_use_pk);

PL/SQL procedure successfully completed.

SQL> exec dbms_redefinition.finish_redef_table('SYSADM', 'T1', 'T2')

PL/SQL procedure successfully completed.

SQL> select * from sysadm.t1;

        ID
----------
TS
---------------------------------------------------------------------------
         1
06-OCT-08 02.30.18.873500 PM -01:00

SQL> desc sysadm.t1
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                        NOT NULL NUMBER
 TS                                                 TIMESTAMP(6) WITH TIME ZONE

SQL>
SQL>

Nicolas.

Tags: Database

Similar Questions

  • Cut the text column's timestamp hh

    Hi all

    I'm cutting the text column's timestamp hh: 2014-02-18 08:39:56

    I tried the format of data as hh: mm, but it does not work as she filed is defined as text and also Cast (Cast (as float) as timestamp) / cast (as a timestamp) did not work.

    many will appreciate any advice on how to solve this problem!

    Hello

    It is a new feature available in 11g...

    Column properties Goto--> column properties--> format of data--> custom--> hh: mm

    This will display the format hh: mm in the timestamp format.

    Thank you

    prassu

  • an alphabet by typing in a cell gives drop down suggestions from previous hits on the same column. But how the drop down to choose the suggestions of the other columns and other sheets.

    an alphabet by typing in a cell gives drop down suggestions from previous hits on the same column. But how the drop down to choose the suggestions of the other columns and other sheets.

    Hi mdsavol,

    Your observations are accurate. The 'suggestions' are previous entries in the same column that correspond to what has been entered so far in the active cell. The only direct user control is to activate the function turn on or off in numbers preferences > general.

    There are other ways to include or exclude items of suggestions:

    • To remove typos in the suggestions list, the user must correct the typos in the cell above the active cell. If they are more in the list, they won't be presented as suggestions.
    • To include selections added to the list, the user must enter these suggestions in the individual cells above the active cell and column where they are wanted as suggestions.

    There was a request here a while there is a list of suggestion 'live' similar to those of some websites, which offers a descending list of possible entries as a type in an input box.

    The only way I see to reach a solution similar to what you have asked is to use as many lines at the top of the non-en-tete of the table section to list the items likely to repeat in your table, and then hide the lines. You'll need a list for each column where you want to use this feature with a list previously planted. Existing items will then require a likely hit up to three, then a click to choose from a list small enough to enter a value into a cell. News he will need to enter in full the first time, but after that it will be put on the list and answer the same thing as the terms preseeded.

    While your setting upward (or decide not to do), consider going on the menu of number (in numbers), choosing to provide feedback from numbers and writing a feature in Apple request. Describe what you want. Explain how he could help the average user numbers, and then hope for the best.

    Kind regards

    Barry

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • Insert columns and research implications need to change formulas

    I have two tables.   The first table with data has 7 columns.  The second table had formulas that had Vloopup choose a cell say, column 6 table 1.  I inserted new t in the middle of the table 1 columns, but the formulas in two table reflect the original column.  I expect that the formulas would have been updated to reflect the new position of the data in the column.  So if the research had received data from Col 6 it would now 8 Col.  That's how I remember it in Excel, is there something that I have not configured correctly or that is a feature.   Thanks in advance you all fine from smart people.

    Hello Gene,

    A glance at the current formula could offer some advice for a possible change.

    One that comes to mind is to use the MATCH to determine the position of the column to the desired source. This would require an exact match between the name of the target column and the name of the source column.

    Kind regards

    Barry

  • Compare multiple columns and return a different value

    I have more access to excel and I'm running my previous workflow in numbers of duplication of issues.

    I have a worksheet when a sheet with all my power tools.  On the "Power Tools" sheet I have columns for the brand, Type, model, purchase date, etc...  An example of this would be: pass a "DEWALT", "Jackhammer" Col B, Col C "DCD995M2" and so on.

    I have a second sheet in the same document which is my front end if you want.  I wanted to have selections for this dynamic drop-down list but it seems it is not possible without scripts, but is not the immediate question yet I'm the mention the case where someone knows a good fix.  The second sheet "Sorting Test", I created manually drop-down boxes, one in column A of the brand and the other in column B for Type.  I'll choose the brand and type and I want numbers autofill the rest of this line based on these two selections.

    Example:

    In the 'Sort Test' sheet I select DEWALT in column A and I select the drill in column B and I want DCD995M2 is displayed in column C and the purchase date in column D and so on.

    Excel in it would be a game table or something similar.  So far every site and search google only gave a lot of people who try to do VLOOKUP or correspond to errors, but I've really met anyone corresponding to two distinct cells from two separate columns and return data from this same line a match was found on.

    I must also mention I'm really trying to avoid adding a hidden line that combines some of these but I know it's the most noticeable work around.

    Basically, I want to match two selections separated against two separate columns, and when it finds the match, I want it returns a different value of this corresponding line how I got everything just copy this formula on adjacent cells and simply adjust to the column in the same row matched.

    I know that I shouldn't do this on separate sheets, but it's just a choice that I made a point of design.

    Any help would be appreciated, because I'm trying to really get the most out of the numbers, especially with how it syncs between desktop and mobile and I have more access to Excel.

    You can it as what you do and why?  This will help us understand what drives the design.  Leave out how to solve the problem,

    also post screenshots can be very useful

  • Table with numeric columns and string

    Hello everyone. I am a new labviewer, so I have 2 questions fundamental.

    1. I found this basic timer loop, which I need to get inside my structure of the event. How to wire this loop with my writing and reading?

    2. I need to wire my digital indicator "Elapsed time" with my table, so I want the 'measure' in the first column and "elapsed time" in the second column. I know I can't mix string and digital indicator in the same table, so the best way would be to make two tables 1 d (digital channel), or there are more basic ways to correct the problem?

    Thanks in advance

    Orlando

    2010:

  • can I write in a clay column and row in excel?

    Hello!!!

    Well, is - can anyone help me and tell me, if I can write something of labview in a clay column and row in excel?

    excellent couerse in a clay column and row to an existing file...

    CAN SOMEONE HELP ME OR SAY SOMETHING PLEASE?

    Ago, as Sophia said, you can do this using ActiveX, but that requires a lot of programming

    but you can learn a lot

  • How can I know the number of columns and lines on excel file

    How reading the number of columns and rows on an excel file after you open the file in excel with ActiveX.

    Using the example of excel200dem, I read that the file data is excellent.

    However, in this example, I just give the number of lines and columns.

    I want to know the number of lines and columns not giving those in C code automatically.

    Who knows this things? -?

    Help me please.

    Hello

    (1) this forum provides a search option, you must use in doing so, you will find this post

    (2) don't solve you your earlier questions? If so, you must mark responses that have helped you find a solution.

  • Customize the table (first column and the first row)

    Hello everyone, I have a question: How can I insert words and numbers in the same table?

    I have create a VI that measure the temperature with an external instrument and put the data into a table, which is saved.

    Each line is a Thermocouple and each column is a measure, but there are only numbers!
    I would have the first column with the name of the channel and line of fist with the name of the measure.

    I had create an excel for example to explain my wish (Cattura.PNG).

    Thanks to all who help me

    You can insert headers required as column and row to convert it to an array of strings, as in the image below.

  • How to query the total number of columns and lines filled with data?

    How to get the number of rows and columns in Exel file data using Excel report?

    Since you have posted this question in the forum of LabWindows/CVI, I guess you want to know how to do with CVI.

    You need to know how to open and activate the Excel data file.

    Depending on the function returns the total number of columns and lines col_count row_count, respectively.

    -----------------------------------------------------------------------------------------------------------------------------------------

    int CountColumnsAndRows (void)
    {
    Error HRESULT = 0;
    CAObjHandle rangeCurrentRegionHandle = 0;
    CAObjHandle rangeColumnsHandle = 0;
    CAObjHandle rangeRowsHandle = 0;
      
    unsigned long col_count = 0, row_count = 0;
      
    Must use the 'A1' property and CruuentRegion count the total of columns and lines, including the drafts!
      
    error = CA_VariantSetCString (& MyCellRangeV, 'A1');
      
    error = Excel_WorksheetRange (ExcelWorksheetHandle, NULL, MyCellRangeV, CA_DEFAULT_VAL, & ExcelRangeHandle);
    If (error<0) goto="">
      
    error = Excel_GetProperty (ExcelRangeHandle, & ErrorInfo, Excel_RangeCurrentRegion, CAVT_OBJHANDLE, & rangeCurrentRegionHandle);
    If (error<0)  goto="" error="">
      
    error = Excel_GetProperty (rangeCurrentRegionHandle, & ErrorInfo, Excel_RangeColumns, CAVT_OBJHANDLE, & rangeColumnsHandle);
    If (error<0)  goto="" error="">
      
    error = Excel_GetProperty (rangeColumnsHandle, & ErrorInfo, Excel_RangeCount, CAVT_LONG, & col_count);
    If (error<0) goto="">
      
    error = Excel_GetProperty (rangeCurrentRegionHandle, & ErrorInfo, Excel_RangeRows, CAVT_OBJHANDLE, & rangeRowsHandle);
    If (error<0)  goto="" error="">
      
    error = Excel_GetProperty (rangeRowsHandle, & ErrorInfo, Excel_RangeCount, CAVT_LONG, & row_count);
    If (error<0) goto="">

    Error:

    CA_VariantClear (& MyCellRangeV);
    CA_VariantClear (& MyVariant);
    ClearObjHandle (& ExcelRangeHandle);
    ClearObjHandle (& rangeCurrentRegionHandle);
    ClearObjHandle (& rangeColumnsHandle);
    ClearObjHandle (& rangeRowsHandle);
      
     
    If (error<>
    ReportAppAutomationError (error);
      
    error return;
    }

  • How to save the table column and row headings

    I have a table where I activated the column and row headings.  Once the table is loaded with data, I would like to save the contents of the table, including the column and row headings in a text file.  The crux of "value" property returns only the content of the table, not the row and column headers.  I could use "header line chains []" and '[] column header chains' property nodes as well, but I'm in the island there is an easier way.  Looks like adding the headers of lines would be difficult.  Any ideas?

    Thanks in advance.

    Here is a way. The construction with the empty constant is to provide to the left corner of the table where there is no data.

  • How can I get my email back contacts views? I can only see my contacts 'online status. I accidentally deleted all the columns and cannot see contacts, emails.

    I can only view my contacts by "online status" in windows live mail.   I accidentally deleted all the columns and cannot see contacts, emails. How to bring back my columns?

    Hi celine,.

    For a more specialized on issue of Windows Live Mail help, post your query on the Windows Live Forum. Windows Live Forum - http://windowslivehelp.com/

  • Concatenate two columns and store it in the existing column

    Hi all

    I created a form based interactive report and need help on that. In the report, I want to display a column with label the CANDIDATE's FULL NAME by concatenating the existing columns in the same table.

    Am mentioning the details and the following questions:

    Table name: CANDIDATE_DETAILS

    Column 1: CANDIDATE_FNAME (first name) Data Type: CHAR (50)

    Column 2: CANDIDATE_LNAME (family name) the data type: CHAR (50)

    Column 3: CANDIDATE_FULLNAME (full name) Data Type: CHAR (100)

    If in the case of column 3 that is, CANDIDATE_FULLNAME is not created in the database, I could have written in query to create one using the concatenation of columns 1 and 2 of the column

    ALTER TABLE CANDIDATE_DETAILS ADD CANDIDATE_FULLNAME TANK (100 CHAR)

    AS (CANDIDATE_FNAME |) ' ' || ( CANDIDATE_LNAME)

    Since then, I have already created CANDIDATE_FULLNAME column, I just change or simply store the concatenation of Column1 and Column2. I tried to use under request, but his does not work:

    ALTER TABLE CANDIDATE_DETAILS

    CHANGE CANDIDATE_FULLNAME ACE (CANDIDATE_FNAME |) ' ' || CANDIDATE_LNAME)

    Also I'm checking the code under SQL Workshop-> SQL commands by entering the query below and his works fine.

    Select CANDIDATE_FNAME. ' ' || CANDIDATE_LNAME

    of 'CANDIDATE_DETAILS '.

    but do not know where to enter this code in "The Page Creator" that without creating an additional column in the database my needs can be met.

    Please let me know if you need more information and really appreciate any assistance.

    Thank you

    Verhasselt

    Hello

    If the requirement is to display the columns and their contents concatenated in a third, you can try this:

    1. create a new column in the report by adding code to the selection of the report:

    Select CANDIDATE_FNAME, CANDIDATE_LNAME, "'"CANDIDATE_FULLNAME"'CANDIDATE_DETAILS'"

    2. in the page editor, select the "CANDIDATE_FULLNAME" column and his correspondents "formatting of column" > "HTML Expression" describe what you like:

    #CANDIDATE_FNAME # #CANDIDATE_LNAME #.

  • How to upgrade are the value of the column and the new column value created

    Hi all

    create the table xxc_temp

    as

    Select donnees_1 'AB103', 'AAA' data_2 data_3 '123', 'RED' data_4, NULL status in all the double union

    Select donnees_1 'AB105', 'BBB' data_2, '222' data_3, data_4 'BLUE', NULL status in all the double union

    Select donnees_1 'AB106', 'CCC' data_2, '333' data_3, data_4 'BLUE', the double NULL status

    create the table xxc_base

    as

    Select donnees_1 'AB103', 'AAA' data_2, '123' data_3 data_4 'RED', 'Inactive' status of Union double all the

    Select donnees_1 'AB105', 'BBB' data_2, '222' data_3 data_4 'BLUE' status 'Active' of all the double union

    Select donnees_1 'AB106', 'CCC' data_2, '333' data_3, data_4 'BLUE', 'Inactive' status of double

    I need to update the status column xxc_temp with xxc_base value of the status column and also if the user tries to insert new values/lines in the xxc_temp

    So how can I update the status column? I mean automatically set to day and also new values/lines

    I need to update only that are Inactive then these lines should be updated in the temporary table

    We can do this by using the stored function, but I need to update the new status of lines also

    Please help me

    Here's another way to do it, using VIRTUAL function column as expression to get the status of the other table

    CREATE or REPLACE FUNCTION GET_STATUS (pDATA_1 IN TANK) RETURN VARCHAR2 DETERMINISTIC

    AS

    vstatus VARCHAR2 (8);

    BEGIN

    SELECT status in vstatus FROM xxc_base WHERE donnees_1 = pDATA_1;

    RETURN vstatus;

    END;

    /

    DROP TABLE 'XXC_TEMP ';

    CREATE TABLE 'XXC_TEMP '.

    ('DONNEES_1' CHAR (5),

    "DATA_2" TANK (3).

    "DATA_3" TANK (3).

    "DATA_4' VARCHAR2 (4).

    'STATUS' VARCHAR2 (8) GENERATED ALWAYS AS (SUBSTR (GET_STATUS (DATA_1), 1, 8)) VIRTUAL

    ) ;

    INSERT INTO 'XXC_TEMP' (data_3, donnees_1, data_2, data_4))

    Select "AB103' donnees_1, data_2 'AAA', '123' data_3, 'RED' data_4 of any double union

    Select donnees_1 'AB105', 'BBB' data_2, '222' data_3 data_4 'BLUE' of all the double union

    Select donnees_1 'AB106', 'CCC' data_2 data_3 '333', 'BLUE' double data_4);

Maybe you are looking for