How to enter time in Oracle?

2

I need to save only hour and minutes (seconds do not make a difference, so have or do not), should I use TIME or TIMESTAMP ?

I started to do with TIMESTAMP(6) , but I'm having a hard time doing insert , what should I do?

My insert:

INSERT INTO EXEMPLO (DESCRICAO, NUMEROMAXIMO, HORAENTRADA, HORASAIDA) 
 VALUES ('Descrição', '50', '15:51:00', '16:51:00');
    
asked by anonymous 19.07.2017 / 17:33

1 answer

2

You can use TO_DATE ;

INSERT INTO EXEMPLO (DESCRICAO, NUMEROMAXIMO, HORAENTRADA, HORASAIDA) 
 VALUES ('Descrição', '50', TO_DATE('15:51:00','HH24:MI:SS') , TO_DATE('16:51:00','HH24:MI:SS'))
    
19.07.2017 / 17:45