Question

Can we execute two SQL Statement with the same Execute immediate

Can we execute two SQL Statement with the same Execute immediate

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What will happen when two processes execute wait() operation on the same semaphore at the same...
What will happen when two processes execute wait() operation on the same semaphore at the same time and wait() operation is not atomic? S=1 wait(S) S){ while (S <= 0) ; // busy wait S } Describe a scenario of context switches where two threads, T 1 and T 2 , can both enter a critical section guarded by a single mutex semaphore as a result of a lack of atomicity.
Two processors, P1 and P2, execute the same instructions. The clock rate and CPIs are as...
Two processors, P1 and P2, execute the same instructions. The clock rate and CPIs are as specified below: Processor                 P1             P2 Clock Rate              2 GHz        3 GHz CPI                          1.0     2.5 For processor P2, we are trying to reduce the time by 40% but this leads to an increase of 20% in CPI. What clock rate is required to achieve this time reduction?
A certain program consists of three independent parts A, B and C that can execute in...
A certain program consists of three independent parts A, B and C that can execute in parallel on separate processors within a multiprocessor system. None of the parts can be further subdivided and each part must execute on a single processor. Part A requires 78 billion cycles to complete, part B requires 40 billion cycles to complete and part C requires 62 billion cycles. The program is executed on an SMP system with 4 identical processors all running at the...
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
Write a SQL statement to retrieve the average number of pages per category
Write a SQL statement to retrieve the average number of pages per category
write an SQL SELECT statement for retrieve the name and income of customers without charges in...
write an SQL SELECT statement for retrieve the name and income of customers without charges in january 2020
Given the following two related tables, write the SQL SELECT statement to solve the following queries...
Given the following two related tables, write the SQL SELECT statement to solve the following queries about developers (Dev) and programs (Prog). The id column in Dev and Prog is the relation between the two tables. Dev(id, name, dept, salary) Prog(id, title, language, lines, size); 1. List name of Devs who have written more than 1000 line programs 2. List title of all programs written in C++ language 3. List name of all developers who have written C++ programs
PS8 JULY 1. Log on to your Oracle ApEx account. Navigate to SQL Workshop à SQL...
PS8 JULY 1. Log on to your Oracle ApEx account. Navigate to SQL Workshop à SQL Scripts Create a SQL script called update_demo_orders that contains these update statements: update demo_orders set order_total = 200 where customer_id = 1; update demo_orders set order_total = 15 where customer_id = 2; update demo_orders set order_total = 12 where customer_id = 3; update demo_orders set order_total = 22 where customer_id = 4; update demo_orders set order_total = 32 where customer_id = 5; update demo_orders...
Write a SQL statement which joins the parts table with the supplier table and lists the...
Write a SQL statement which joins the parts table with the supplier table and lists the part_name, supplier_name for all parts in the part table. The supplier_id column in the suppliers table is the primary key in the suppliers table, and this key has been exported to the parts table where it is a foreign key. You should use an inner join for this query. Write a SQL statement which joins the parts table with the suppliers table and lists...
Class SQL performs automatically; discuss at least two risks inherent in letting SQL Server to perform...
Class SQL performs automatically; discuss at least two risks inherent in letting SQL Server to perform conversion. In your opinion what is the best approach for insuring that any data type conversion will work all the time as expected? Provide a vivid example to summarize your written detail explanation.