db and dev 10g rel2
i want to build a table which has a column holds "time" (only time) not date and time , but unfortunately i do not what data type should i use ?
then , i will build a form based on that table , a form which has a field to insert and query that column , and i also do not know what data type should i use for that field ?
thanks in advance
i've tried to build a "date" column as you've said and changed the format mask of the field based on that column to hh24:mm:ss , and it is working if you try to insert the time into the field ,i tried to insert "11:11:11" into the field , but unfortunately , when i query the table from the data base , it show "01/11/13" , and i do not know why , and offcorse i do not want that , i want the time i inserted to be shown"11:11:11"
and please do not tell me it is a normal thing , because may be i should do calculations on this field and another .
thanks a lot
Edited by: semsem on Jan 6, 2013 2:56 AM
The time is only a part of a date. When you query a date (or better date/time-column) you have to define in what format you want to see the date. So you have either to change the settings of your tool so that it shows the data in the way you want, or you have to explicitly cast the date-column to a string using TO_CHAR with the appropiate format-mask.
i thought of a pre-insert trigger and write in it :
to_char(datefield,'hh:mi') but if i can insert it like in the database , a nother problem pops up which is i can not do calculations on it .(-,+,*,/) , and may be i want this .