Change in the column date year

Ok

I have the column type Event_Time DATE. He is the owner of this type of values: ' 21.04. * 0010 * 10:59:30 '

Now, I don't want to change anything, except the YEAR. I want to replace "0010" with "2010".

What is the best way to do it?

THX

Maybe something like that? (Note: this is not tested):

UPDATE  
SET     event_time = TO_DATE('2010' || TO_CHAR(event_time,'MMDDHH24MISS'),'YYYYMMDDHH24MISS')
WHERE   TO_CHAR(event_time,'YYYY') = '0010'
;

Tags: Database

Similar Questions

  • How to export pictures / albums of iPhotos to external disk and keep the time/date/year and location information changed?

    How to export pictures / albums of iPhotos to external disk and keep the time/date/year and location information changed?

    Menu, file == > export - check boxes to include metadata and location- export to iPhoto

    LN

  • How to cut the column data

    Gurus in the morning

    I have two tables with the data in the corresponding column, BUT I need to cut the columns in a table
    the data is displayed as follows in table xpq_log
    LOG_DATE                     LOG_PTR     LOG_HDR
    01/06/2011 00:00:00     0609pro     0609IN002C_06
    04/06/2011 00:00:00     0609pro     0609IN002C_06
    05/06/2011 00:00:00     0609pro     0609IN002C_06
    06/06/2011 00:00:00     0609pro     0609IN002C_06
    07/06/2011 00:00:00     0609pro     0609IN002C_06
    09/06/2011 00:00:00     0609pro     0609IN002C_06
    10/06/2011 00:00:00     0609pro     0609IN002C_06
    12/06/2011 00:00:00     0609pro     0609IN002C_06
    01/06/2012 00:00:00     0609pro     0609IN002C_06
    02/06/2012 00:00:00     0609pro     0609IN002C_06
    03/06/2012 00:00:00     0609pro     0609IN002C_06
    06/06/2012 00:00:00     0609pro     0609IN002C_06
    07/06/2012 00:00:00     0609pro     0609IN002C_06
    08/06/2012 00:00:00     0609pro     0609IN002C_06
    09/06/2012 00:00:00     0609pro     0609IN002C_06
    In the table of printpdf as follows
    PDF_REPORT     PDF_DESCRIPTION
    IN002C                     STOCK FILE PURGE - PRINT WH CONTROL
    How can I cut the column data (log_hdr) to match column (pdf_report)?

    Any help will be much appreciated

    user11978142 wrote:
    Yes the code always starts with an alphabetic character and always ends before the underscore character and the prefix is always digital.

    And Yes to the second comment WRT 1 to many relationship.

    WRT the duplicates I want the info displayed even if there is no matching printpdf

    You talk a LEFT OUTER JOIN, then:

    See the example below (the statement are just to reproduce the paintings, just use the last query):

    WITH xpq_log AS
    (
       SELECT '0499SYS003A_06' log_hdr FROM DUAL UNION ALL
       SELECT '0612PV410W1_06' log_hdr FROM DUAL UNION ALL
       SELECT '0609IN002C_06' log_hdr FROM DUAL UNION ALL
       SELECT '2201PA100D1_30' log_hdr FROM DUAL
    )
    , printpdf AS
    (
       SELECT 'SYS003A' pdf_report, 'STOCK FILE PURGE - PRINT WH CONTROL' description FROM DUAL UNION ALL
       SELECT 'PV410W1' pdf_report, 'Description 2' description FROM DUAL
    )
    SELECT a.log_hdr, REGEXP_SUBSTR (a.log_hdr, '[[:alpha:]][^_]*') AS pdf_report
         , b.description
      FROM xpq_log a LEFT OUTER JOIN printpdf b
           ON pdf_report = REGEXP_SUBSTR (a.log_hdr, '[[:alpha:]][^_]*');
    
    Output:
    LOG_HDR        PDF_REPORT     DESCRIPTION
    -------------- -------------- -----------------------------------
    0499SYS003A_06 SYS003A        STOCK FILE PURGE - PRINT WH CONTROL
    0612PV410W1_06 PV410W1        Description 2
    2201PA100D1_30 PA100D1
    0609IN002C_06  IN002C                                           
    

    Kind regards.
    Al

  • ToolTip on the column data

    Hello

    I want to display the ToolTip on the column data.
    To this end, I work with the data format.
    under data format I use custom format.
    on the format of data, I wrote the following code.

    < b title = "This" about says month"> month < /b >

    but it demonstrated ToolTip on 'months' and not on real data.

    Is any HTML that display dynamic data, then we can put this code instead of 'months '.

    Please, give me suggestion.

    Concerning

    Prashant

    Did you add the ' @' in your HTML simbol? They must state the values in your column.

    You should have something like months @

    KR,
    A

  • Use the Quick Date year section in the column header

    Version 11.1.1.7

    I have a dashboard command prompt which invites for a date.

    My analysis is filtered on this prompt.

    My data looks like this:

    Accounting_Date FY1_Data FY2_Data FY3_Data

    31 AUGUST 2014 200 300 400

    AUGUST 31, 2013 275 325 450

    My requirement is to display the exercise as the heading of column (as opposed to FY1_Data, FY2_Data, FY3_Data).

    FY1_Data is the year of the accounting Date - 2.

    FY2_Data is the year of the Date of accounting order - 1

    FY3_Data is the year of the accounting Date

    So, for the first record in my table example, the column headers must be (2012, FY2013, FY2014)

    For the second disc, the column headers must be (fiscal year 2011, 2012, FY2013).

    To do this, I have tried the following to the first column only:

    I put the column header to FY@{Year1}

    Then I put my dashboard accounting cut-off Date prompt to fill a variable presentation (ActPrdDt).

    Then I created another guest of 'Variable' dashboard with a year1 variable name.

    In this prompt, I used SQL results as the default selection:

    Select 'Date_Table '. "' Accounting_Date ' from 'MySubjectArea' where 'Date_Table '. "" Accounting_Date "= @{ActPrdDt}

    The problem is that the full date is displayed in the column header (AFA 08/31/2014).

    I tried to modify the sql statement in my second guest of dashboard for

    Select TO_CHAR ("Date_Table". "Accounting_Date", "YYYY")-2 of... "

    but the column header displays all values in the column, which is usually what it displays when there is an error in the sql statement.

    Is it possible to manipulate the sql statement to get only the year of the accounting Date and subtract 1 or 2 him?


    I changed the sql statement

    Of

    TO_CHAR ("Date_Table". "Accounting_Date", "YYYY")-2 "

    TO

    extract (year of "Date_Table". "Accounting_Date")-2 "

    This solved my problem.

  • Unable to store the component "time" in the column date Oracle's ADF

    Hi friends,

    I have a table with the date column. I'm trying to set the current date with the time in the column of the table. Java.sql.Date refers to the field of the VO. When I try to turn it using the setLastUpdatedDate() it not be saved. The time is get truncated and the time is saved is 16-mar-2015 00:00:00.  How can I keep the component "hour" as well in the column with the date data type. FYI the component "hour" is saved when I do the sql uisng the insert.

    JDev version is 11.1.1.7.0

    Thank you

    Hello

    java.sql.Dateis the DATE of SQL which means it stores years, months and days whilehour, minute, second and millisecond are ignored. Also sql.Date is not related to time zones.

    java.sql.Timestampcorresponds to the SQL TIMESTAMP, which is the exact nanosecond (Note that util.Date only supported milliseconds!) with customizable precision.

    try to use the timestamp if you want exact

  • XMLTable: definition of the columns data type of table

    Hello world

    I am using ORACLE 11 g and you want to shred XML into a table called test used. I was hoping I'd be able to get the types of data to the employees table existing instead of specify them in the clause of columns. Is this possible?

    Here is an example of what I'm trying to do. But I get an error: PL/SQL: ORA-00907: lack the right parenthesis on the line starting with columns.
        insert into EMPLOYEES
         select *
           from xmltable(
           '/employees/employee'
            passing EMP_XML
    
            columns FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE path 'first_name',
                    LAST_NAME  EMPLOYEES.LAST_NAME%TYPE  path 'last_name',
                    GENDER     EMPLOYEES.GENDER%TYPE     path 'gender',
                    AGE        EMPLOYEES.AGE%TYPE        path 'age'
            );
    Error details
            columns FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE path 'first_name',
                                *          
    
    ERROR at line 16:
    ORA-06550: line 16, column 42:
    PL/SQL: ORA-00907: missing right parenthesis
    ORA-06550: line 11, column 5:
    PL/SQL: SQL Statement ignored
    Thank you.

    Specification of column names is required, but you can omit the declaration of data types.

    See: the function XMLTABLE SQL/XML in Oracle XML DB

    XMLTable is used with storage XML based on a schema of XMLType data type is optional. If absent, the data type is inferred from the XML schema. If Oracle > XML DB is unable to determine the right type of a node, a default type VARCHAR2 (4000) is used.

    It is an Oracle extension; in the SQL/XML standard, the data type is always required.

    Note:
    The alleged data type might change as a result of the application of a patch or upgrade of Oracle XML DB. In particular, a new set of release or patch might be able to > determine the data type when the previous version was unable to do so (and therefore not reimbursed to VARCHAR2 (4000)). To protect against such an eventuality, specify an explicit data type with the data type.

  • Navigation from the column data

    JDev ADF BC 11.1.1.5.0

    Is it possible to provide a navigation of the column?
    For example, I have a column named "Accounts" to my table and there a few records. Each record should appear as a hyperlink that will lead me to a page where I can see the account information in detail.

    Suppose you already have an af:table with the data in it. Change the af: inputText / af:outputText for an af:commandLink account number - you can do it in source view (you will need to remove all properties that are not valid for af:commandLink). Set the Action property to point to a rule of control flow that takes you to the detail page. (If you were on 11.1.2.x, you must apply the hotfix that Frank details in the first part of the post that I linked you - this hotfix verifies that by clicking on the order link allows the current record).

    It is literally all you should have to do.

  • changes in the column...

    Hi guys,.

    just trying to understand what is the concern of my apps to the dba teams.

    One of the colume in this table is currently in:

    number (6.3) and they asked is there no impact if it were to change-> the precision of the column 'XX' to 6 decimal places. What does that mean and what is the new value then?

    Read the documentation, but do not really understand.

    There will be any impact as invalid objects. Or objects failed to change the structure of the table. New column or total change to add the data type of an existing column.

    >
    Why it will be a problem since I will increase to 6 fear? So if it goes across 3 my new scale value still can accommodate it.
    >
    I said it COULD be a problem. It would not be a problem depending on the data that you use.
    If you have inserted data EVER with more than 3 decimal places before, then there is a problem.

    But if you don't you may have lost some of the data

    This simple example and see what I mean:

    CREATE TABLE SCALE_TEST2 (ID NUMBER, NUM6_3 NUMBER(6,3), NUM9_6 NUMBER(9,6))
    
    INSERT INTO SCALE_TEST2 VALUES(1, .00049, .00049) -- do this line 10 times to insert 10 records
    
    INSERT INTO SCALE_TEST2 VALUES(2, .00051, .00051) -- do this line 10 times to insert 10 more records
    
    SELECT ID, SUM(NUM6_3) TOT6_3, SUM(NUM9_6) TOT9_6
    FROM SCALE_TEST2 GROUP BY ID
    
    ID = 1    TOT6_3 = 0      TOT9_6 = 0.0049  -- old value is less than new
    ID = 2    TOT6_3 = 0.01 TOT9_6 = 0.0051  == old value is greater than new
    

    For ID = 1 values will< .0005="" will="" always="" become="" 0="" (truncated)="" for="" a="">
    ID = 2 values > =.0005 and< .001="" will="" always="" become="" 1="" (rounded="">

    Records you add more the difference.

    That IS THE PROBLEM - if you reload old data that had more than 3 decimal places in the new table, and then you actually change the data in the table and it will act as the data in the above example. None reported that the data rollup and group them differently may show slightly different than the old report because of the truncation and rounding results that occurred.

    >
    Don't tell me we have to understand how to write code to "get" these value expect you and that is causing the problem.
    >
    Looks like you don't need me to tell you that since you already know.

    SELECT * FROM SCALE_TEST2  WHERE ABS(NUM9_6) > 999.999999
    

    All selected lines have values of NUM9_6 who might not fit into a column NUMBER (6.3). ABS (absolute valuel) is necessary because the data could be negative.

    Always TEST, TEST, TEST and use the data which includes the MAX and MIN values that may occur.

  • How to divide the column Date OBIEE

    Hello
    We have the name of the date column: To_Date and the format is DD/MM/YY hh.
    How to divide the date in YEARS, MONTHS, DAY as new columns.
    kindly help on that.


    Kind regards.
    CHR

    Published by: 867932 on November 23, 2011 22:18

    Hi user,

    All 3 functions can be written in RPD too. MDB layer, duplicate the date column-> the mapping tab to column of Goto-> expression-> functions Builder Select-> calendar Date functions / hour-> select DayofMOnth function. The column of your logic formula will look like,

    DayofMonth (YourDateColumn)

    Rgds,
    DpKa

  • Addition of days for the column date of OBIEE

    Hi gurus,

    I have a date column, date alert and based on this column, I need to create another column to date, due date. The formula will be like,
    Due date alert = date + 30 days. I found a function, TimeStampAdd when you change the column formula but not sure how to use it. Pls help me to implement this.

    Thanks in advance.

    TIMESTAMPADD(SQL_TSI_DAY,30,alertdate)

    TIMESTAMPADD (interval, intExpr, timestamp)

    e.g:TIMESTAMPADD (SQL_TSI_DAY, 3, TIMESTAMP'2000-02-27 14:30:00 ')

  • Change in the columns InDesign police

    I have a body of text in InDesign, which is formed in columns by using the tab (as below)

    EXAMPLE example example

    Info Info Info

    Is it possible that I can format the columns differently?  For example, can I change the second column of bold text and the third the italics?

    Yes, use the Styles nested in your paragraph style.

  • Online update of the column data in the sql statement

    Hello Experts,

    I created a sql report
    select apex_item.checkbox(1,RES_RTNG_ID) as "RATING ID",RES_ID,SKILL_SET_ID, to_char(EVALUATION_DATE,'DD-MM-YYYY') d, EVALUATOR, RATE_TYPE, RATING ,REMARKS
    from HRMS_RESOURCE_RATING
    where TRAINING_ID = :P51_TRNG_PLN_ID
    I have a box that is used to delete rows in the report.
    and I want features to update the data in the column of the report.
    Please help me how to do this.

    Thank you
    Jitendra

    Hi all

    I did it with inline sql reports updated. Those who want to implement online update of sql reports

    Please see the link below:
    http://roelhartman.blogspot.in/2009/11/UPDATEABLE-interactive-report-websheets.html?z

    Thank you
    Jitendra

  • Any way to change/replace the EXIF data such as the date of the photo?

    I import into Lightroom several thousand photos I took with my first digital camera, in 2000-2004. Everything went very smoothly. But here's my problem:

    In my old workflow, I spent the time of photo montage liquidated as TIF files, and stripped of any program that I used to edit the EXIF from them. Thus, for example, a photo that was taken on March 4, 2001 has the information EXIF showing it was taken on March 10, 2001, the date on which I edited and made the TIF. All other EXIF data is stripped as well, the data on exposure, lens information, ISO, if the flash is triggered, etc.. Basically, the TIF file seems to have no other than my name and the size of the file EXIF data.

    I can't live without the other info, really, but the change of information on the initial date/time means that the TIF file is not sort next to the original file in Lightroom, which I want to do. There are not thousands of photos that I have hair, a few hundred maximum.

    Is it possible with a plugin or an external program to copy EXIF information in the original program and insert it in the TIF file?

    To change the date to use the Edit capture time option located under library > metadata menu.

  • A loop in the column date - hours per day in summary

    All,

    Run the query against my timesheet tables below, I get the following results:

    SQL - CODE

    SELECT
    TS.ts_date Date,
    TS.user_name name,
    SCI Account account,
    TS.no_of_hrs hours,
    Sum (TS.no_of_hrs) OVER (PARTITION BY ts.ts_date) Daily_Total
    Of
    eba_time_timesheet ts,
    eba_time_timecodes tc
    WHERE
    TS.timecode_id = tc.id AND
    TS.user_name AS "JohnD".
    ORDER BY
    1

    -RESULTS-

    Date name hours Total daily
    1 December 09 JOHND 489310 1.5 8
    1 December 09 JOHND 486830 1.5 8
    1 December 09 JOHND 481710 3 8
    1 December 09 JOHND 481210 8 0.5
    1 December 09 JOHND 486840 8 0.5
    1 December 09 JOHND 485710 8 0.5
    1 December 09 JOHND 481010 8 0.5
    December 2 09 JOHND 481710 1 8
    December 2 09 JOHND 485710 7 8
    December 3 09 JOHND 481710 6 8
    December 3 09 JOHND 488810 1.5 8
    December 3 09 JOHND 481310 8 0.5
    4 December 09 JOHND 489710 8 8
    7 December 09 JOHND 481110 8 0.5
    7 December 09 JOHND 489710 7 8
    7 December 09 JOHND 481210 8 0.5

    However, I prefer the Total column everyday be a row in the results instead of a column. Here's an example of how I prefer the results. This statement will then be sent to a calendar for each user to see here for each account and total time twice a day.

    Date name hours
    1 December 09 JOHND 489310 1.5
    1 December 09 JOHND 486830 1.5
    1 December 09 JOHND 481710 3
    1 December 09 JOHND 481210 0.5
    1 December 09 JOHND 486840 0.5
    1 December 09 JOHND 485710 0.5
    1 December 09 JOHND 481010 0.5
    * 1 December 09 JOHND daily Total 8 *.
    December 2 09 JOHND 481710 1
    December 2 09 JOHND 485710 7
    * 2 December 09 JOHND daily Total 8 *.
    December 3 09 JOHND 481710 6
    December 3 09 JOHND 488810 1.5
    December 3 09 JOHND 481310 0.5
    * 3 December 09 JOHND daily Total 8 *.
    4 December 09 JOHND 489710 8
    * 4 December 09 JOHND daily Total 8 *.
    7 December 09 JOHND 481110 0.5
    7 December 09 JOHND 489710 7
    7 December 09 JOHND 481210 0.5
    * 7 December 09 JOHND daily Total 8 *.

    Any help would be greatly appreciated.

    This is my 1st post, so if I missed something or you need more information please let me know.

    I use Oracle 10 g

    Hello

    Welcome to the forum!

    Whenever you have a question, it helps if you post the CREATE TABLE and INSERT statements for some examples of data.
    For example:

    CREATE TABLE     eba_time
    (     ts_date          DATE
    ,     name          VARCHAR2 (10)
    ,     account          NUMBER (6)
    ,     no_of_hrs           NUMBER
    );
    
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  489310,  1.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  486830,  1.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  481710,  3);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  481210,  0.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  486840,  0.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  485710,  0.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  481010,  0.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('2-Dec-09', 'DD-Mon-RR'),  'JOHND',  481710,  1);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('2-Dec-09', 'DD-Mon-RR'),  'JOHND',  485710,  7);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('3-Dec-09', 'DD-Mon-RR'),  'JOHND',  481710,  6);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('3-Dec-09', 'DD-Mon-RR'),  'JOHND',  488810,  1.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('3-Dec-09', 'DD-Mon-RR'),  'JOHND',  481310,  0.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('4-Dec-09', 'DD-Mon-RR'),  'JOHND',  489710,  8);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('7-Dec-09', 'DD-Mon-RR'),  'JOHND',  481110,  0.5);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('7-Dec-09', 'DD-Mon-RR'),  'JOHND',  489710,  7);
    INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('7-Dec-09', 'DD-Mon-RR'),  'JOHND',  481210,  0.5);
    

    I know that you have in fact two different tables, but if you already know how to join them, you could simplify a bit the issue by claiming there is only a single table. Could you tell what you're doing, like this: "what I posted as eba_time really is a join of two tables separate."

    GROUP BY... CUMULATIVE (or GROUPING SETS) is a convenient way to get totals for the same set of results with the raw data. It helps if you have a primary key or a sime column that uniquely identifies each row.

    Published by: Frank Kulash, April 21, 2010 12:17

Maybe you are looking for

  • My iMac has a SSD slot?

    I have an iMac EMC 2546. It's an inventory item, no customization when buying. It; s drive is a 1 TB. Hoe can I get out of this disc is an SSD? This player can be replaced with a SSD? This drive can be completed with a 2nd disc it's a SSD?

  • Cannot view a streaming video

    I own a laptop dv6-2150us I recently had to do a recovery on because he only will re-start after automatically download and install updates Windows (2011-09-16). After recovery has been made, and various resettlement programs, I found that I can't wa

  • Change visible tab based on action

    I'm new to labview and threw the materials of the intro, but I've reached a mental block preventing me to understand this. What I'm trying to do, is create a VI with 3 tabs. The first tab is basically a configuration for the serial port. Once the use

  • Help start the old computer system32/hal.dll error not installed bugs not working-

    I want to transfer files from your old computer to new computer with Vista Easy Transfer.  In an attempt to start former computer, received the system32\hal.dll error.  I followed the instructions to fix proglem reboot, press / hold down f8, etc., bu

  • Smartphones from blackBerry Desktop Manager: error needs to close

    Hi all I prowled around and tried to solve this problem, now I ask for assistance at the feet of the masters... Simply, Blackberry Desktop Manager has worked well because original install last November.  Recently, I get the popup "BlackBerry Desktop