Home > Back-end >  i'm using oracle live it showing ORA-00936: "missing expression" error
i'm using oracle live it showing ORA-00936: "missing expression" error

Time:07-08

i'm using oracle live it showing ORA-00936: "missing expression" error.

create table dat(da date); insert into dat values(date('06/03/76', 'dd/mm/yy'));

CodePudding user response:

Your syntax is incorrect. Try this, using to_date:

create table dat(da date); 
insert into dat values(to_date('06/03/76', 'dd/mm/yy'));
commit;

Table DAT created.


1 row inserted.


Commit complete.

CodePudding user response:

“date” is not an Oracle function. Try using to_date

CodePudding user response:

Another point of view says that DATE is actually OK, but the rest isn't.

If you wanted to use date literal, then you'd

SQL> create table dat(da date);

Table created.

SQL> insert into dat values(date '1976-03-06');

1 row created.

SQL>

because date literal always looks like that: date keyword followed by value enclosed into single quotes in yyyy-mm-dd format.

  • Related