Update in more than one line

Asked

Viewed 822 times

2

I’m trying to ride a update thus:

UPDATE cad_vendas SET canal ='9', parceiro ='9' 
WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90'
and forma_pagamento <> '';

but he won’t accept it if I don’t pass the id line and are several lines.

Does anyone have a solution where I can give uptade in N lines?

  • What error returns?

  • What is the relationship with the tag jQuery? Are you sure this query is valid? In this case, there are records that meet the 3 conditions of the where?

1 answer

2


It does this for security, to prevent you from doing a wrong update across the bank, for example.

Add the key information he is requesting.

For example:

UPDATE cad_vendas SET canal ='9', parceiro ='9' 
WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90'
and forma_pagamento <> '' and id > 10 and id < 30;

or

UPDATE cad_vendas SET canal ='9', parceiro ='9' 
WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90'
and forma_pagamento <> '' and id in (10,20,30,40,50 )
  • Thank you Reginaldo Rigo, I hadn’t really thought of it! It worked right, thank you!

Browser other questions tagged

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