Is it possible to enter only time value into a column of a
table in sql?

Answers were Sorted based on User's Feedback



Is it possible to enter only time value into a column of a table in sql?..

Answer / zaheer

No,
you can store as (HH24:MI) at form level, also make format
DateTime.
Query by - to_date(HH24:MI)
Also you can use Timestamp - I tied it in Oracle 10g. It
will store date and time

Is This Answer Correct ?    0 Yes 0 No

Is it possible to enter only time value into a column of a table in sql?..

Answer / nannesaheb c

There is no such data type is existed in Oracle to store the time in a column directly.

However we can insert the time value in a column using the sql functions as below.

SELECT substr(to_char(sysdate,'DD-MON-YYYY HH:MM:SS'),12,20) FROM dual;

create table time1
(
today_time varchar2(10)
);
insert into time1 values(substr(to_char(sysdate,'DD-MON-YYYY HH:MM:SS'),12,20));

Regards,
Nanne

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

How to list all tables in your schema?

0 Answers  


Will the Optimizer always use COST-based approach if OPTIMIZER_MODE is set to "Cost"?

1 Answers  


Hi All, Recently I attended a interview for a developer position in an educational university. They asked me the a question, I answered somehow but I was not not satisfied myself. Can anybody reply for it? The question is: A business user comes to you directly with an urgent request:: there is a problem with some students not being able to re-enrol. It appears that ?something has gone wrong with the end-dating of some previous courses they had enrolled in, and this is preventing them from completing their on-line re-enrolments?. Fortunately the user has done some analysis on the situation, and has developed some code to change the end dates. They tell you that they have tested this code in the ?dev? environment, and it works fine. They are asking you to please get this implemented in production as soon as possible. What steps would you take in response to their request ? Thanks

2 Answers  


Which Database is the best for the Security issue ? 1. DB2 2.SQL Server 3.MySQL 4.ORACLE

1 Answers  


How to upsert (update or insert into a table)?

0 Answers  






What is the data pump import utility?

0 Answers  


4. Using a set operator, display the creditor number of all creditors who have ever been paid.

2 Answers   Wipro,


What are the factors causing the reparsing of SQL statements in SGA?

2 Answers  


How to list all user accounts in oracle?

0 Answers  


What is partitioned table in Oracle?

0 Answers   MCN Solutions,


Which is better Oracle or MS SQL? Why?

2 Answers   Bally Technologies,


What is the exact use of Collections?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)