facebook

Format dates with date and time in SQL result

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #239823 Reply

    tmccauley
    Member

    I am looking for a way in the SQL results to display/format a data to have date and time like a time stamp instead of just the date 🙁 . Is there a way to do that in the Database Explorer.

    #239854 Reply

    Riyad Kalla
    Member

    Does your column support that level of granularity? Are you sure you didn’t just select a type that only stored the date (and note a timestamp)

    #239947 Reply

    tmccauley
    Member

    The data is in an Oracle database of type date. But I insert it as Timestamp and is stored as Timestamp. But when I try to look at it in the database explorer it only shows the date and not date and time.

    #239972 Reply

    Riyad Kalla
    Member

    It looks like you need to use TO_CHAR if you wish to see more granularity: http://www-db.stanford.edu/~ullman/fcdb/oracle/or-time.html

    #240002 Reply

    tmccauley
    Member

    I am sorry. I can display the time in my code and I know how to use the TO_CAHR. What I would like to be able to do is display the date and time in the DB Browsers – Table Info – Preview tab. There the date or timestamp is displayed as a date only. I would like to be able to change the date colum in the preview tab to display date and time and not date only. Sorry for the confusion and thanks for your time. By the way I viewed the say data in Squirrel-sql and it will display date time.

    #240010 Reply

    Riyad Kalla
    Member

    This may be a problem, because right now the information displayed in the preview is just doing a straight select, per that link above it looks like to be able to view more granulated information from the DATE column type, you need to use TO_CHAR and specify a formatting string, in the case of the DB explorer, that level of customization is not supported.

    #243375 Reply

    Joseph Li
    Member

    hi ,

    I am running into this problem as well but I beleive its more like a JDBC driver issue. Basically the newer Oracle driver actually truncate the time portion of the Date when retrieving from DB while it stores ok.

    Ref : http://forums.oracle.com/forums/thread.jspa?threadID=155494&tstart=0&messageID=1018387

    The question would be, is there a way to set these properties when DBExplorer opens the connection? I tried putting those setting in both eclipse.ini and config.ini but still doesn’t work. Any other options???

    Joseph

    #243406 Reply

    Brian Fernandes
    Moderator

    Joseph,

    Thank you for pointing us to that thread – I was able to both replicate and fix the issue by changing my eclipse shortcut like so:
    c:\eclipse\eclipse.exe -vmargs -Doracle.jdbc.V8Compatible=true

    Please note the -vmargs switch – that sends all succeeding arguments to the VM, not eclipse. If you wish to modify your eclipse.ini file instead of the shortcut, use the following line in the file.
    -vmargs -Doracle.jdbc.V8Compatible=true

    Let us know how it turns out,
    Best,
    Brian.

    #244941 Reply

    support-michael
    Keymaster

    We discovered a bug that was causing Oracle 9i to drop the time element in date information. This bug has been fixed and will be available the upcoming ME 4.1 GA release.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Format dates with date and time in SQL result

You must be logged in to post in the forum log in