-2
I was already having problems creating this table in relation to time, but finally, with help I managed to solve the problem. In the end I came across another mistake, but I don’t understand why.
Follows the code:
create table horario (
codhorario number (8) primary key,
horainicio DATE to_char (horainicio, 'hh24:mi'),
horafim DATE to_char (horafim, 'hh24:mi'));
My mistake:
ORA-00907: missing right parenthesis
I researched on the internet about and ended up finding that it could be more or less parentheses, but that could also be syntax error. Anyone can help?
Why to call the to_char function when creating a table?
– Daniel Mendes
Hmm I don’t know exactly how to implement it, I thought it was in this format. How would it be then?
– user315139192111315
You want a field to save hours?
– Daniel Mendes
This, 2 in the case of start and end. But it seems to_char is in the wrong place.
– user315139192111315
to_char
returns a string, but the field is aDATE
, then it no longer makes sense. If you want to keep only the hours, there are some alternatives– hkotsubo