Several UPDATES in the Firebird database

Asked

Viewed 693 times

-3

I can create a method that performs several updates in the Firebird database? For example, I want to update the following record, but it would have to be one at a time, have to update otherwise?

UPDATE TVENPEDIDO SET NOTAFISCALSERVICO ='18593'WHERE CODIGO = '0000523'
UPDATE TVENPEDIDO SET NOTAFISCALSERVICO ='18594'WHERE CODIGO = '0000516'
UPDATE TVENPEDIDO SET NOTAFISCALSERVICO ='18595'WHERE CODIGO = '0000513'
UPDATE TVENPEDIDO SET NOTAFISCALSERVICO ='18596'WHERE CODIGO = '0000082'
UPDATE TVENPEDIDO SET NOTAFISCALSERVICO ='18597'WHERE CODIGO = '0000571'
  • Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).

1 answer

3

Essentially, it doesn’t have. There is nothing standardized in this code that can make it generic (there is no apparent criterion of what causes what), it is all individual. But if you can rewrite that code some other way then maybe you can do something, but only you know this.

It only scares a code that does this, in general it is gambiarra since it deals with specific items literally. Unless the code is not this.

  • There’s a way, yeah, buddy, I figured it out.

  • Just copy the code, go to the script run and put at the end of each line a ";" and check the use Current connect option

  • @Eduardoteixeira using the same connection only leaves the connection open to execute several commands in sequence, but does not use the same method to perform several updates. Or we all misunderstand your question.

Browser other questions tagged

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