Can we execute two SQL Statement with the same Execute immediate
Question: Can we execute two SQL Statement with the same Execute immediate?
Answer: Yes, it is possible to execute two SQL Statement with the same Execute immediate.
Please refer to the below-provided example for more clarity.
Two separate Execute Immediate:
begin
EXECUTE IMMEDIATE 'UPDATE table_customer SET NAME = ''Jack'' where ROW = 3';
EXECUTE IMMEDIATE 'UPDATE table_customer SET NAME = ''Mark'' where ROW = 4';
end;
Single Execute immediate:
begin
EXECUTE IMMEDIATE '
begin
UPDATE table_customer SET NAME = ''Jack'' where ROW = 3';
UPDATE table_customer SET NAME = ''Mark'' where ROW = 4';
end;';
end;
Please let me know in the comments in case of any confusion. Also, please upvote if you like.
Get Answers For Free
Most questions answered within 1 hours.