1

因此,正如昨天有人建议我的那样,我正在使用 SQL Fiddle,因为它是一种测试数据库查询和 SQL 编程的简单方法,但我收到了这个错误:

Schema Creation Failed: ORA-01821: date format not recognized

这发生在插入行中。这通常在 Oracle 中有效,我在 Oracle 11g 页面顶部的组合框中进行了选择。所以有什么问题?

create table Reparacoes(
numero_r int,
matricula char(8),
dataEntrada date,
constraint pk_carro primary key(numero_R),
constraint check_matricula check (regexp_like(matricula,'[[:number:]]{2}-[[:alpha:]]{2}-[[:number:]]{2}')));

insert into Reparacoes values (1,'S2-SS-12',to_date('yyyy-mm-dd','2013-11-10'));
4

1 回答 1

2

由于我自己的愚蠢,我用to_date错了。它应该是这样的:

to_date('2013-11-10','yyyy-mm-dd'));

而不是这样:

to_date('yyyy-mm-dd','2013-11-10'));

于 2014-01-20T18:11:03.047 回答