SP2-0552: Bind variable "19" not declared

2

I am using Oracle SQL Developer to terminate a project, when the database was popular, the software accused an error in the following line:

INSERT INTO musica (cod_musica, data_composicao, titulo, duracao)
VALUES (11111, '1993/01/01', 'Fênis', '22/12/2016 00:15:19 123');

data_composicao is as DATE and duracao is as TIMESTAMP , even when I take the '' I can not make it work, thanks for the attention.

    
asked by anonymous 22.12.2016 / 20:49

1 answer

1

I believe that the fraction of the seconds that you are using separately, is wrong, the correct one being separate with a dot;

The mask for the fraction of seconds is set by FF ;

The value saved in the duracao field has the format of day / month / year, so the mask should follow this format (dd / mm / yyyy);

In this way, your insert will look like this:

INSERT INTO musica (cod_musica, data_composicao, titulo, duracao)
VALUES (11111, TO_DATE('1993/01/01', 'yyyy/mm/dd'), 'Fênis', TO_TIMESTAMP('22/12/2016 00:15:19.123', 'dd/mm/yyyy HH24:MI:SS.FF3'));

In this post , you have a nice answer about the TIMESTAMP .

Oracle Documentation

    
23.12.2016 / 13:06