Use Execute block in SQL

Asked

Viewed 795 times

4

Is there any way to search two fields (in different tables), compare them and if they are different perform an update? Could you give me a brief example if there is any way, using the EXECUTE BLOCK.

  • this solved that question ?

1 answer

1


Something like that:

    execute block
as
  begin
    IF ( (select numero from btr01 where numero=150000) = (select numero from btr01 where numero=150001))
        THEN update btr01 set serie='123' where numero=150000;
        ELSE update btr01 set serie='321' where numero=150001;
  end

Browser other questions tagged

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