LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-11-2005, 07:56 PM   #1
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Rep: Reputation: 31
Storing four digit time in oracle


I'm writing an oracle script and i noticed a table with column "time" was set to datatype number. Ideally I'd like them as a value oracle recognizes as time. I want to put (for example) 18:21 into my table. I tried with timestamp and had no success then I tried date and had no success again!

The times are not values for comparing or calculating. In my case its what time to pickup someone from a wedding. I have the wedding date in a separate column so I don't want the full 7 character values assigned by timestamp just 4 digits with just 18:21 in...

Any ideas would be great and i really appreciate any help i get.

Thanks a lot
 
Old 03-11-2005, 11:33 PM   #2
dustu76
Member
 
Registered: Sep 2004
Distribution: OpenSuSe
Posts: 153

Rep: Reputation: 30
I don't think Oracle has a way of storing data in HH24:MI format. You either store them as date (DD-MON-YYYY HH24:MI:SS (phew!) or simply as VARCHAR2(5) (in which case you don't get to compare).

If you just want to view the info VARCHAR2(5) is what you need...

HTH.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can bash generate random digit? sorno Linux - Newbie 5 08-17-2005 06:05 AM
storing text in a text file for a specified length of time. mrobertson Programming 7 08-02-2005 10:27 AM
54 digit numbers Scratchit General 3 06-23-2004 09:24 AM
java, reversing digit Lifesaver Programming 5 03-03-2004 04:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration