Varchar-> Timestamp

Hello Experts,

BANNER

Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0-Production
AMT for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production

select timestamp from all_objects;
This is varchar2 (19) timestamp field.

Now I need to get only of time, for example; 05-30 or 17-30.

Help, please

Thank you...

Hello

Linus wrote:
Hello Experts,

BANNER

Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0-Production
AMT for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production

select timestamp from all_objects;

This is varchar2 (19) timestamp field.

Now I need to get only of time, for example; 05-30 or 17-30.

SUBSTR to get a part of a larger chain.
http://docs.Oracle.com/CD/B19306_01/server.102/b14200/functions162.htm#sthref2169
For example, if t = ' 2012/07/06 09-32-28', then

SUBSTR ( t     -- source string
       , 12     -- starting postition
       , 5     -- length of returned sub-string
       )

Returns the substring starting with the 12 character, which is 5 characters, in this case ' 09-32'.

I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using.
See the FAQ forum {message identifier: = 9360002}

Moreover, from Oracle 9, TIMESTAMP is an Oracle reserved word, and you can be difficult to use as the column name if you ever upgrade. If it is not too late, rename your column. TIME_STRING would be a better name, anyway, since this column is a string of characters.

Tags: Database

Similar Questions

  • Problem to convert varchar timestamp

    Hi all

    I have a varchar column with data such as,

    2008-08 - 01 T 12: + 00:00 00:16.000000


    I need to extract "2008-08-01 12:00:16 ' and put in a solumn timestamp."

    How is it possible.


    I tried the below query,


    SELECT to_date ((to_date ((SUBSTR ((REMPLACER (TI, ' t ',' ')), 1, 20)), 'YYYY-MM-DD HH24:MI:SS')), "YYYY-MM-DD HH24:MI:SS") OF TI;


    which gives only 8 August 01 '


    How can I do this? Please help me solve this.

    Thanks in advance,
    Knani

    What? Why you'd be wasting your time?

    You are only it lose on your screen because you do not specify any it correctly to display. Internally the date data type is always a moment but it defautls to 00:00:00 if you don't provide information in time on the initial to_date.

    Variable data type date or a timestamp (pontentially with time zone) or is the target table?

    Just format the string in the buffer expected time format and use to_timestamp on it, if the target is a timestamp.

    Since the 10 gr 2 manual SQL

    SELECT TO_TIMESTAMP ('10-Sep-02 14:10:10.123000', 'DD-Mon-RR HH24:MI:SS.FF')
       FROM DUAL;
    
    TO_TIMESTAMP('10-SEP-0214:10:10.123000','DD-MON-RRHH24:MI:SS.FF')
    ---------------------------------------------------------------------------
    10-SEP-02 02.10.10.123000000 PM
    

    HTH - Mark D Powell.

  • How to convert a timestamp in tank

    Hai all

    How to convert a timestamp to varchar

    I had a query called Cube_instance

    Here, the creation date is declared as timestamp. This is my request

    Select count (1) in the cube_instance where ID_processus like 'PreAdviceHandler %' and
    CREATION_DATE between July 30, 10 00.00.00.000000' and
    31 JULY 10 00.00.00.000000';

    My result is when I run this query, I need the count starts from 30 declaring Jul and 30 jul ending when I run the present 31 Jul


    How to convert this varchar timestamp and give the condition


    Kind regards

    Srikkanth.M

    Published by: Srikkanth.M on July 31, 2010 01:53
    select count (1)
    from cube_instance
    where process_id like 'PreAdviceHandler%'
       and creation_date between trunc (sysdate) and trunc (sysdate + 1) - interval '1' second;
    
  • Convert Varchar to timestamp

    Hello

    I have a varchar field that contains timestamp in it.
    It's in the format below
    01/07/2013 14:00:06.597000

    During the conversion of the sam format timestamp, milliseconds change January 7, 13 02.00.06.597250000 PM

    Why is this happening? Any idea. Pls help in this regard.

    Thank you
    KVB

    Do not use SCOTT... Use FF ==> HH24:MI:SS AAAA-MM-JJ. FF

    S is for the second...

  • How to convert varchar in timestamp

    "in the comic book, I have an indtalledDate of column with a varchar data type - and value is as ' Thu Dec 20 07:33:20 PST 2012." Now, I need to convert this format of timestamp-> 20 December 12 07.47.49.463000000 AM. How can I do?

    can someone pls help?

    Check this box:

    SELECT CAST (
              TO_TIMESTAMP_TZ ('Thu Dec 20 07:33:20 PST 2012',
                               'Dy Mon DD HH:MI:SS TZR YYYY') AS TIMESTAMP)
      FROM DUAL
    

    See you soon,.
    Manik.

  • convert varchar in timestamp (3)

    Hello people,

    Can someone help me convert a varchar2 (200) in a timestamp (3).

    I want to in this format 7 December 06 12.00.00.000000000 AM'

    Thanks in advance.
    SQL> select to_timestamp('Oct 21 2009 12:59PM', 'Mon DD YYYY HH12:MIAM', 'NLS_DATE_LANGUAGE = ENGLISH') from dual;
    
    TO_TIMESTAMP('OCT21200912:59PM
    -------------------------------------------------
    21/10/09 12:59:00,000000000
    

    Again, as it was said Centinul, remember that it is an internal representation that has nothing to do with the way it is displayed on your screen

    Published by: fsitja on December 22, 2009 12:53 AM
    Edit for an independent solution of NLS

  • How to convert the timestamp in varchar2

    How to convert

    -timestamp

    TO_TIMESTAMP (' 29.01.2015 08:36:41 ','fmDDfm.fmMMfm.YYYY fmHH24fm:MI:SS') of double

    in

    -varchar2

    20150129083641

    Hello

    Maybe something like this:

    select to_char(to_date(substr(to_char(TO_TIMESTAMP('29.01.2015 08:36:41','fmDDfm.fmMMfm.YYYY fmHH24fm:MI:SS')),1,17), 'dd.mm.yy hh24:mi:ss'), 'yyyymmddhh24miss') from dual;
    

    But the question is: what do you do? Sorting? Or you have a (very) old data model with varchars or numbers to organize the date fields?

    concerning

    Kay

  • How to prevent the Automatic Conversion of TIMESTAMP Format column (0) WITH ZONE VARCHAR2

    Hello

    I created a view of my table and columns with the date format is automatically converted to varchar type...

    How can I avoid this?

    Create view V_T2 as

    Select

    MAX (DECODE (RESULT_TYPE, THE FROM ', DECODE (BACKUP_LEVEL_ID, 'F', LAST_START, NULL), NULL)) LAST_SUCCESS_FULL_START,.

    MAX LAST_SUCCESS_INC_START (DECODE (RESULT_TYPE,' TO DECODE (BACKUP_LEVEL_ID, 'F', NULL, LAST_START), NULL))

    of backup_log;

    the first 'LAST_SUCCESS_FULL_START' column format remains TIMESTAMP (0) WITH ZONE SCHEDULE, but the other changes to VARCHAR.

    the LAST_START column in my table in the source format is also TIMESTAMP (0) WITH ZONE SCHEDULE.

    Thank you for helping me.

    user649075 wrote:

    Create view V_T2 as

    Select

    MAX (DECODE (RESULT_TYPE, THE FROM ', DECODE (BACKUP_LEVEL_ID, 'F', LAST_START, NULL), NULL)) LAST_SUCCESS_FULL_START,.

    MAX LAST_SUCCESS_INC_START (DECODE (RESULT_TYPE,' TO DECODE (BACKUP_LEVEL_ID, 'F', NULL, LAST_START), NULL))

    of backup_log;

    The NULL value is treated as a VARCHAR2 since she does not have a real data type.

    Try to CAST as the appropriate data type.

    cast( null as timestamp(0) with time zone)
    

    MK

  • To_date removes timestamp of VARCHAR2

    Hi guys,.

    I am faced with this strange problem - when I convert a varchar with timestamp date value, remove it we timestamp. I need the timestamp it is to type Date. Could you please help.


    --------------------------------------------------------------------------------
    DECLARE
    gv_creation_date_from VARCHAR2 (150);
    pi_creation_date_from VARCHAR2 (150);
    BEGIN

    pi_creation_date_from: = ' 2012/01/17 08:14:26 ';
    DBMS_OUTPUT. Put_line (' pi_creation_date_from = ' | pi_creation_date_from);
    gv_creation_date_from: =.
    To_date (pi_creation_date_from, "YYYY/MM/DD HH24:MI:SS");
    DBMS_OUTPUT. Put_line (' gv_creation_date_from = ' | gv_creation_date_from);
    END;

    --------------------------------------------------------------------------------
    OUTPUT OF DBMS
    pi_creation_date_from = 2012/01/17 08:14:26
    gv_creation_date_from = 17 January 12

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

    Setting NLS_DATE_FORMAT is

    SELECT isdefault, VALUE, TYPE
    THE PARAMETER $ v
    WHERE name = 'nls_date_format.



    --------------------------------------------------------------------------------
    FAKE DD-MON-RR 2

    Appricate your help, thanks in advance.

    -Sylvain

    Use a variable of type date not varchar2. When you define a variable varchar to a date that oracle has to convert the varchar2 data type date, which means that it uses your NLS_DATE_FORMAT which most likely does not contain part of the time, that time is truncated.

  • I want to convert timestamp column varchar2 (3) column

    Hi all

    I have a column of field date with varchar2 data type:

    Date

    --------------------------------------------------------------------------------
    13/03/2011 10:22
    13/03/2011 10:22

    I tried this:
    select to_timestamp(date,'MM/DD/YYYY HH:MI AM') from dual;
    Using above query iam get timestamp (9) instead of timestamp (3):

    18/10/2010 12:31:00.000000000 PM

    My requirement is:

    I want to convert varchar 2 to timestamp (3)

    can someone help me!

    Thanks in advance!

    You must apply a CAST

    SQL> ed
    Wrote file afiedt.buf
    
      1  select cast( to_timestamp( '3/13/2011 10:22 AM',
      2                             'MM/DD/YYYY HH:MI AM' )
      3                as timestamp(3) ) timestamp_3_column
      4*   from dual
    SQL> /
    
    TIMESTAMP_3_COLUMN
    ---------------------------------------------------------------------------
    13-MAR-11 10.22.00.000 AM
    

    Note, however, that it is a very bad idea to store the date information in a VARCHAR2 column in a table. Inevitably, you will get invalid data that lead to the TO_TIMESTAMP call failure that will require that you create a function that performs the conversion and manages the inevitable exceptions.

    Justin

  • A bug in the timestamp of text messaging

    Hello. I would like to report a little bug in iOS 10 and below, in text messaging. When I send a sms and conversation contains more than one message, if I delete the last conversation and leave the rest of it canceled, the timestamp of the message I deleted is shown as the timestamp of the message in the main menu of the e-mail, while the original message has been deleted. I mean, when you delete a message, the timestamp of the previous message should appear as the timestamp of the message in the main menu, not the one's who no longer exists. For example, when I delete the last message (with 09:04 timestamp), if the timestamp of the message remaining (12:41 am) should logically be included in the main screen, but 09:04 is always displayed in the main menu.

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

    Here is the screenshot of the problem:

    The timestamp of the last message is 09:04. -> > >

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

    Below, I've removed the last message (which was the time stamp 09:04), so that the last post time is 12:41 am logically. -> > >

    ---------

    But, in the main menu, the previous time is always displayed as the timestamp of the message-> > >

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

    I think that the time stamp in the main menu should show you the last message that you CURRENTLY HAVE in your conversation, not one that has been deleted and no longer exists.

    09:04 belongs to the message that I deleted.

    The timestamp should be turned into 12:41.

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

    Hellllllloooooooo!

  • A shippers sometimes emails get the timestamp of 31/12/1969 18:00. Why?

    A sender of guaranteedrate.com has had three of his e-mails on five or six receive the timestamp of 31/12/1969 18:00 when in fact he sent them in the past two weeks. This place well in the slot more early possible date and found only because they appear as an unread. I don't remember what happens with someone else. It's time to plant; I am Central time. He's in Chicago; I'm in Houston. I always run the latest Thunderbird, now at 38.3.0. My OS is XP sp3.

    I meet also now "threading" of the messages that I have not opted in for and that I don't like.

    Thanks for any help.

    The number of thread

    In the Thunderbird menu bar
    View - sort by - (Date?) - (down?) - not threaded
    (If no Menu bar visible, press onAlt')

    Matter of time.

    In simple terms
    The sender, or a mail server goes by, has a low battery or dead in the CMOS, which prevents the computer from forming properly validates a date/time group.
    Or, if the date/time group is damaged in some way.

    The computer uses the time standard UNIX to calculate the date and time.
    It starts at 0 as of January 1, 1970 00:00 GMT and increases by 1 every second. Computers can calculate a date and time by calculating the number of seconds since the beginning of the time UNIX.

    If a computer shows a group 31 December 1969 time - 18:00, this indicates that the computer is 6 hours west of Greenwich, England, in the early period, or is located in the central area WE delay / Canada

    This isn't a problem with the recipient's computer or with Thunderbird.
    The recipient must contact the sender and let her know the problem of time, so he can check his own machine or notify his local mail server.

    TB - 38, 3 Win10-PC

  • Use the timestamp when another cell contains one of two values

    Hi everyone again,

    I am struggling with a formula more in number. I have a formula whose time stamps the current date in a cell when a corresponding cell in the map is filled with '1 '.

    =IF(C3=1,TODAY,"")
    

    Hey Joe,

    IF and WHERE are your friends.

    Formula in D3 (fill down)

    = IF (OR (C3 = 1, C3 = "G"), TODAY (),"" ")

    Today is dynamic; It is not a timestamp.

    If you open the document tomorrow, it will be a new today (July 23, 2016, at least in Australia).

    Do you want a real timestamp (scheduled) or a dynamic date?

    Kind regards

    Ian.

  • I have a problem with a timestamp changed on my error report, I was wondering if I could get someone to help?

    Mozilla crashed about 15 minutes in an online evaluation timed for my university studies I can't repeat. The attempt to get information on the crash, so that my University could see that I was not lying about the time of the accident and the site I was on, the timestamp changed when I clicked on the link for more detailed information.

    I was wondering if there was anywhere I could get the original timestamp as time seems to have changed on my subject: blocking the page as well.

    Emergency assistance would be most appreciated.

    Hello abital, about: crashes, click the ID of the accident in question to open on the site of the crash - stats.mozilla.com & switch to the 'Metadata' tab you will find a field named CrashTime who then has time when the accident occurred initially in the form of a Unix timestamp. You can convert this value to a format readable by a service such as www.epochconverter.com

  • Why some texts have timestamps and others do not?

    I am trying to determine the exact time that I received a message, but it doesn't have a timestamp. Help?

    All the texts have timestamps.  You may need to press some and drag them to the right on the left to see them.

Maybe you are looking for

  • Recover pages

    If no additional contributed a documento nuevo as aun ha guardado, cierrelo y haga click in eliminate en el cuadro diálogo save that appears. Sin querer di y eliminate me gustaria poder recuperarlo. ¿Hay alguna manera?

  • DV4T-1400: what is the maximum amount of ram supported on DV4T-1400

    What is the maximum amount of ram supported on DV4T-1400

  • laptop freezes at the office on a log-in user only. ESENT errors

    Acer laptop - Windows 7 Home Premium - 2 user profiles of school boards. One works perfectly. Other starts Windows slowly, shows the wallpaper, begins to show the desktop shortcuts, then freezes before be correctly displayed. Start button responds so

  • Blue screen problems with Windows 7 64 bit

    It's my first time ever to come here so go easy on me if I have not posted correctly haha. Anyway, I came here to see if anyone can help if all goes well shed some light on the issues I'm having. I get these blue screens recently and below I have pos

  • BlackBerry Smartphones need help with youtube

    Hiya using m.youtube.com When I try to play a video, I get the message - device media processor is busy Anyone have any ideas? I downloaded xenozu app thinking that might work, but I get an error with this too. -usually that it is impossible to conne