convert the date value in column 1 help

Am on 10g.

I have a column: STAMP_DATE with these values:

I leave the INHERITANCE, as it is, but everything else, I need to convert to the: MMYYYY as in: 092010 for example.

9 sep means so seven-2009. The number is the year, I am trying to solve this problem.

Any SQL help would be appreciated, thanks!

STAMP_DATE
"LEGACY".
"9-sep.
'9 - Oct'
'9 - Nov'
"" 9-may
'9 - Mar'
"9 - Jun"
"9 July".
'9 - Dec'
"9-Aug.
"April 9.
'10-May '.
'10 - Mar'
'10-jan.
'10 Feb.
"" 10 Apr

These values were imported from Excel using SQLLDR, so he made them a bit like that.

with s as
(select 9 - Sep' double jnk)
Union
Select ' 9 - APR ' double jnk
)
Select to_char (to_date(jnk||) (("e - 01 ', ' AA-MON-DD '), 'DD-MM-YYYY') s
/

Seems to be working at home time tonight.

-------------
Sybrand Bakker
Senior Oracle DBA

Tags: Database

Similar Questions

  • Number of days since 31/12/1979 converting a date value?

    Hi all

    I'm not an expert in oracle sql and I hope that someone could help me.  A column of a table is titled BHS_KDTE_SEQU.  This column has 111616 lines and the values stored in these areas are the number of days since 31/12/1979.

    When I write a select statement, how can I convert to get the date value since 31/12/1979 instead of the number of days?

    Thank you in advance!

    Hello

    f429ff94-4133-48E0-AE1C-afcb148d3c2f wrote:

    Hi all

    I'm not an expert in oracle sql and I hope that someone could help me.  A column in a table is called BHS_KDTE_SEQU.  This column has 111616 lines and the values stored in these areas are the number of days since 31/12/1979.

    When I write a select statement, how can I convert to get the date value since 31/12/1979 instead of the number of days?

    Thank you in advance!

    Then

    1 means January 1, 1980,

    2 means January 2, 1980,

    ...

    31 January 31, 1980, means

    32 means February 1, 1980.

    ...

    366 means December 1, 1980,

    367 means January 1, 1981,

    and so on?

    Here's one way:

    SELECT DATE ' 1979-12-31' + bhs_kdte_sequ AS dt

    TABLE;

    When you add a DATE d and a NUMBER n in Oracle, the result is the DATE n days after days.

    I hope that answers your question.

    If not, post a small example of data (CREATE TABLE and INSERT statements) and the exact results you want from these data.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • If the default value in columns on slot form of table does not work.

    Hello

    I created a tabular form and I want to set some default values to columns that are based on the values of page elements.

    so I put the page element to the value of the column in the attributes in a table by selecting the value & P24_ISSUE_ID. default type as Expression PLSQL & DEFAULT function there but
    in the same way, I tried for the other column by selecting the type default as pl/sql expression and function by default the value & P24_CASE_NAME.

    but it throw an error of this type could not parse the SQL query: ORA-00904: "C254DB": invalid identifier

    I don't understand where I did wrong, I checked for the data types of columns, all right.

    so please help me out of this problem.

    1243 Tulasi wrote:
    for the first column

    I chose
    The DEFAULT TYPE as PL/SQL Expression & FUNCTION

    As the default * & P24_ISSUE_ID.* it is a number data type column

    2nd column

    The default Type as PL/SQL Expression & function

    As the default * & P24_CASE_NAME.* it's column of type Varchar2.

    Element (name of the page element or application) for the default Type and the name of the default item ( P24_ISSUE_ID, P24_CASE_NAME etc.) options appropriate for a default value for a page element.

    * & P24_ISSUE_ID.* is not a "PL/SQL Expression or function.

    but it throws an error, because this guy could not parse the SQL query: ORA-00904: "C254DB": invalid identifier

    What you're doing results in the engine of the APEX, P24_CASE_NAME 'C254DB' value in the default value and then try to assess this string as a piece of PL/SQL. Outside a block in which it is defined as a variable, constant, or a function 'C254DB' is not a valid expression of PL/SQL.

  • Error: Please enter the date value in the correct format DD-MON-RRRR

    Hi all
    First of all, I am 100% not learning financial oracle no technical information. I'm trying to run a report: - the calendar does not appear in order for me to choose the date - not to mention that when I enter the date IE 10/09/2010 or on 09/10/2010 the system gives me this error "" error: Please enter the date value in the correct format DD-MON-RRRR ".
    Please help me to solve this.

    Thank you

    Please enter date in format 12 October 2010.

    Kind regards
    http://www.oraerp.com

  • display the data in row columns

    I looked through the previous posts, but it is impossible to find a solution to my problem.

    I want to display the data in row columns.
    I have shown in the table below and test data and the sql code that gives me the result desired.
    However, you can see that the sql depends of me knowing all the values in the column "rank".
    I want a way to produce the output without knowing the values of rank.
    CREATE TABLE test1 (
      accno       NUMBER,
      holder_type VARCHAR2(10),
      rank        NUMBER)
    
    INSERT INTO test1 VALUES (1, 'acr', 0);
    INSERT INTO test1 VALUES (1, 'bws', 1);
    INSERT INTO test1 VALUES (1, 'aaa', 2);
    INSERT INTO test1 VALUES (2, 'cds', 0);
    INSERT INTO test1 VALUES (2, 'xxx', 1);
    INSERT INTO test1 VALUES (3, 'fgc', 0);
    INSERT INTO test1 VALUES (4, 'hgv', 0);
    INSERT INTO test1 VALUES (4, 'bws', 1);
    INSERT INTO test1 VALUES (4, 'qas', 2);
    INSERT INTO test1 VALUES (4, 'aws', 3);
    
    Here's the required output:=
    ACCNO     ALLCODES
    1     acr bws aaa
    2     cds xxx
    3     fgc
    4     hgv bws qas aws
    
    I.E. for each accno display the holder_types in rank sequence.
    
    SELECT * FROM
    (SELECT 
           a0.accno,
           a0.holder_type || DECODE(a1.holder_type, NULL, NULL, ' ') ||
           a1.holder_type || DECODE(a2.holder_type, NULL, NULL, ' ') ||
           a2.holder_type || DECODE(a3.holder_type, NULL, NULL, ' ') ||
           a3.holder_type || DECODE(a4.holder_type, NULL, NULL, ' ') ||
           a4.holder_type allcodes
      FROM (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 0) a0,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 1) a1,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 2) a2,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 3) a3,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 4) a4
     WHERE a0.accno = a1.accno(+)
       AND a0.accno = a2.accno(+)
       AND a0.accno = a3.accno(+)
       AND a0.accno = a4.accno(+)) a
       ORDER BY accno

    So you're after what we call 'Aggregation in the chain.'

    Check this link as it highlights several techniques:

    Aggregation of string techniques

    A Re: Concat ranks of the values in a single column Michael

    At Re: multiple lines in a single line in the 'single column Table' followed by reason of Billy on the conduct of a stragg first.

    In addition, 11 GR 2 has the LISTAGG function.

  • How to convert the binary value to a binary string in labview?

    Hi all

    I need to convert the binary value to a binary string. We have decimal or hexadecimal or octal number to decimal string, hexadecimal and octal string

    Hi pgm, use the function 'Format to a string. See the attached example. "%b" is the binary number in number in string format specifier.

  • How to convert the date in milliseconds?

    Hi all

    Can I know how to convert the date in milliseconds?

    My current datetime like this Formate

    QDateTime::currentDateTime (m:System.NET.SocketAddress.ToString ("MMMM dd, yyyy HH"))

    Seconds since January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toTime_t

    Sinds milliseconds January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toMSecsSinceEpoch

  • Change the default value of column NOT NULL to NULL

    Hi all
    How can I change the default value of column not NULL to NULL?
    Suppose I have run the following commands:
    SQL> alter table hr.test modify temp_num2 default null;
    
    Table altered.
    
    SQL> desc hr.test;
     Name                            Null?    Type
     ----------------------------------------- -------- ----------------------------
     TEMP_NUM                             NUMBER
     TEMP_NUM2                       NOT NULL NUMBER
    Why forced temp_num2 has not changed with the NULL value? I'm under 11.g rel2

    Best regards
    Valerie

    You can NOT change the column constraint NULL to contain NULL values by:

    alter table table_name modify column_name null; 
    

    After this change, the column can contain null values. In Oracle, not null constraints are created automatically when not null is specified for a column. Similarly, they are deleted automatically when the column is changed to allow NULL values.

  • How to validate the Date value in the text column

    Hi all

    I entered DATE value in the element of text field (Char Data Type), now how do I validate, the entered date is valid or not.

    Thanks in advance.

    Well, the easiest would be to make the part of DATE data type.

    Another possibility is to try to convert the value to a date in the WHEN-VALIDATE-POINT-trigger, as

    DECLARE
      dt DATE;
    BEGIN
      dt:=TO_DATE(:BLOCK.ITEM);
      -- if code comes here, the date is valid
    EXCEPTION
      WHEN OTHERS THEN
        -- seems to be no valid date
        MESSAGE('Error');
        RAISE FORM_TRIGGER_FAILURE;
    END;
    

    Published by: Andreas Weiden on 19.12.2010 12:23

  • the data of a column based on the value of color.

    Hi guys,.

    I use APEX 4.0.2

    I'm changing the color of the column 'calling_date' so it would be blue when it is equal to sysdate. I typed this code in the Source of the interactive report region.
     case
       when calling_date = sysdate then '<span style="color: #3399FF;">' || to_char(calling_date) || '</span>'
       else to_char(calling_date)
    end CALLING_DATE 
    And then I changed the "display AS text" column 'Standard report Column '.

    But wouldn't change the color!

    Kind regards

    Published by: Fateh June 2, 2011 12:38

    >
    I applied it, but he gave me like a tank I can't order according to date of color.

    case
       when trunc (calling_date,'DD') =  trunc(sysdate,'DD') then
     '' || to_char(calling_date) || ''
       else to_char(calling_date)
    

    If I remove "TO_Char", I get this error:

    incompatible data types: expected DATE got TANK

    Tony Miller, thank you. I followed the instructions on your link, but I got the same error:

    incompatible data types: expected DATE got TANK
    >

    Tyler method uses * columns * 2 in a standard State:

    select
             calling_date
           , case
               when trunc (calling_date,'DD') =  trunc(sysdate,'DD') then '#3399FF'
               else 'inherit'
             end color
    ...
    

    then combined using an HTML Expression:

    #CALLING_DATE#
    

    It is not available in an interactive report (not sure if this information was clearly in the op?)

    In the IR, generate a HTML comment at the cutting edge of the column that supplies the required using the semantics of character sort order:

    select
    ...
           , case
               when trunc(calling_date,'DD') =  trunc(sysdate,'DD')
               then
                 '' || to_char(calling_date) || ''
               else
                 '' || to_char(calling_date) || ''
             end calling_date
    ...
    
  • Obligation to convert the numeric value to a char

    Hi all

    I have a requirement to convert numeric values in the column the char values.

    For example:

    Column1
    1
    2
    .
    .
    1000

    Result

    one
    two
    .
    .
    a thousand

    Please let me know how I can do it.

    Thanks in advance.

    Best regards
    Pavan

    Published by: Pavan Poirier on February 17, 2011 07:26

    Published by: Pavan Poirier on February 17, 2011 07:27

    If one of the English words are used, and the value is not very high, then this can help you

    select to_char(to_date(1000,'J'),'Jsp') from dual
    
    One Thousand
    

    JSP means: set Julian date format.

  • Change the Data Type of column on large partitioned Table Tablet

    Hello

    I was tasked to change a certain NUMBER of collar to a colonel VARCHAR2

    It is usually an easy task, but I ran into several challenges due to the size of the table, the second major problem is the compression of the table.

    To begin with, the Table and index are 4.4 to and hold around 11 lines billion. That the Table is compressed, not the index.

    The first option was to add a new collar of VCHAR, update from the Col de NUM, file and then drop the colonel NUM


    We ran this test in the Test environment and because discovered Compression Table that you can only mark the column is not used, and it can only be moved permanently from the Table if you unzip the whole Table and run «...» REMOVE the UNUSED COLUMNS'.

    The second way is to create a separate Table copy with the values of the source of neck, then write to null to the source of neck, change data Type when its empty and then update the source again with the copy Table values.

    The second option, that's what I'm testing, but I work with nearly 30 million lines by daily score, inserts take very long to fill.

    How can I make faster inserts between the Source and the copy Table?

    What other channels follow to accomplish the task above?

    Concerning

    Stephan

    Nowhere in your proposed solution was necessary for you to understand why the data source changes, its as simple that to take what is ons the table (all the facts in the original post) and offering the best way on the basis of previous experience or oracle skills acquired over time.

    If you spent so much time and thought to help with a solution that you did on WHY complain, you could have provided some feasible solutions already.

    No thanks to your information irrelevant and unnecessary, I've implemented a solution already.

    1 export the Source Table

    2. create a 'replica Table' using the DDL source using a temporary table name

    3. import all Partitions in the Table new

    4. before the Cut-Over, synchronize the changes from the Source to the replica Table

    5 rename the Source

    5 rename the Table of replica for the Original Source Table name

    6. slide the original Source Table

  • convert the data-&gt; layer mask vertex position position

    I have 2 videos (A; (B) whose corresponding value of markers, I need to distort the video so the position of the markers would correspond to the position of the corresponding markers in video B.

    The markers are easy to spot, but I can only request data followed the anchor layer,

    while I can use for the distortion (Reshape, revision deform or Morph) the tools work with masks.

    I need a way to convert the caterpillars position data to control individual mask points.

    Someone knows or can write this script?

    much help appreciated

    Yes, as David said, with local Tracker2Mask mode, you can move individual points mask with track points of the tracker item AE.

    See this tutorial:

    Tracker2Mask - advanced functions and local change mask | mamoworld

    My MaskTrackerPlus not help not in this particular case, since he cannot move together masks, but individual vertices not independently.

  • Dictionary of data values in column view (s)

    The following query is the list of the most fragmented tables.

    My question is that I do not understand why the value of the blocks is multiplied by 8. Is because the value of column of blocks show a kilo byte? so convert us kilo bits?

    My second question is, what is the value of these columns represent in general? In other words, when I look at the data of avg_row_len how can I understand the which type of data it represent?

    For example: avg_row_len, the number in this column represents byte? or kilobye?

    select table_name,round((blocks*8),2) "size (kb)" ,
                      round((num_rows*avg_row_len/1024),2) "actual_data (kb)",
                     (round((blocks*8),2) - round((num_rows*avg_row_len/1024),2)) "wasted_space (kb)"
    from dba_tables
    where (round((blocks*8),2) > round((num_rows*avg_row_len/1024),2))
    order by 4 desc

    Thanks in advance.

    So what you don't understand? Num_Rows * avg_row_len gives "average you" number of bytes occupied by the data in the table. Num_Rows * avg_row_len/1024 is same in KB. And round ((num_rows*avg_row_len/1024), 2) round it to two decimal places. blocks * 8 (as I said, code you posted assume table block size is 8K) is the space allocated to the table in KB. And I have no idea why code is rounded, something that is whole number to start.

    SY.

  • convert the data that are not text

    create table x as
    (line_1 varchar2(10))
    INSERT INTO x  VALUES ('001165899', '0506', 'ZIP1003', 'ABC', 'xyz')
    It is the source table, it transforms (to meet the requirements of the company) to another table where column line_1 is converted to a data type of number, and all the data in the column of line_1 which is the text are converted to-1.

    user628919 wrote:
    How the hyphen may be replaced for the data where it grows in different places within the data.

    The solution needs to keep other rules - convert to_number, text-1 column, ignore nulls (see below)-, more remove the hyphen of digital data.

    to_number(regexp_replace(line_1, '.*\D.*', '-1'))
    

    As Vivek L, complete with a convenient link for documentation, said "replace should work.

    to_number(regexp_replace(replace(line_1, '-'), '.*\D.*', '-1'))
    

    John

Maybe you are looking for

  • Photos in the Finder

    I can't find my photo files in the Finder.  For example, I want to attach a photo in an e-mail message.  I click on the paper clip icon to attach a file, and it opens Finder.  When I select the pictures folder, it shows the folders where photos might

  • Reflect anything on TV?

    Will be what whether the picture on the TV from my iPod Touch 6 & the iPhone 6? For example, if I had to surf the web on safari, or play a game directly from the iPod 6, which will reflect on the TV, as well as any application? Thanks in advance! (:

  • SCB-68 drawing board

    Someone next to the circuit board inside the SCB-68?  Thank you.

  • Windows 10 and Lumia 540, extra web camera phone to receive the code

    I am a novice user of 69. I use window 10 (wndindow free 8.1) According to the advice that I bought the window Lumia 540 For 8 months is received much help from Microsoft. problem: I do not use my computer and mobile, in two days I always inform your

  • How change the extra-large font to normal

    My cat has somehow changed the font to extra-large size and I was unable to change it using the settings, it shows that it is normal. Does anyone have an idea what happened and how can I change it back?