Problems entering a datatime record

Asked

Viewed 27 times

1

This is the description of my table in Mysql

inserir a descrição da imagem aqui

That’s how I’m inserting the records

insert into pedido
(data_criacao,data_entrega,
entrega_cep,
entrega_cidade,entrega_logradouro,entrega_numero,entrega_uf,
forma_pagamento,status,valor_desconto,valor_frete,valor_total,cliente_id,vendedor_id)
values(2013-08-17 11:25:00,
2013-08-20,34400000,"Uberlandia","Rua das arvores grandes",300,"MG","DINHEIRO","ORCAMENTO",0.00,0.00,1000.00,1,1);

This is the error that is appearing in the table;

inserir a descrição da imagem aqui

The error is on line 6, how do I enter the record correctly;

1 answer

3

Values date, datetime, timestamp as well as text(char, varchar, text etc) need to be in quotes, preferably single ones, depending on the server setting double quotes can also be used to identify table names, columns and other database objects, this setting is known as ansi Quotes.

insert into pedido
(data_criacao,
data_entrega,
entrega_cep,
entrega_cidade,entrega_logradouro,entrega_numero,entrega_uf,
forma_pagamento,status,
valor_desconto,
valor_frete,
valor_total,
cliente_id,vendedor_id)
values
('2013-08-17 11:25:00',
'2013-08-20',
34400000,
'Uberlandia',
'Rua das arvores grandes',
300,
'MG',
'DINHEIRO',
'ORCAMENTO',
0.00,
0.00,
1000.00,
1,
1);

Browser other questions tagged

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