Invalid Types of Data

Asked

Viewed 798 times

1

I am trying to create a table in my database, however it is giving error of invalid data types

Script from my table:

create table Venda
(
  cod_Venda number(5)not null,
  DataVenda DATE,
  Hora TIME,
  cod_Comanda number(5)not null,
  constraint PK_cod_Venda_Venda PRIMARY KEY(cod_Venda)
);

Error:

Command Line Error : 486 Column : 8 Report of errors - SQL Error: ORA-00902: Invalid data type 00902. 00000 - "invalid datatype" *Cause:
*Action: commit.

I am using SQL Developer. Could someone help me?

  • Have you tried to remove (5) from the front of the number?

  • Use DATE in the statement, for the TIME field.

  • Use DATE in Datasale and record the date and time , not needing a field for TIME.

1 answer

1

There is no Time data type in Oracle. Date fields keep century, day, month, year , hours minutes and seconds.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.