Question: 6. (34 points) What does the following programming example in emi embedded SQL in C do? A. (22 points) The following is a C program
6. (34 points) What does the following programming example in emi embedded SQL in C do? A. (22 points) The following is a C program segment E2 processing multiple tuples at a time using cursor with embedded SQL: //Program Segment E2: 0) prompt("Enter the Department Name: ,dname) i 1) EXEC SOL 2) select Dnumber into :dnumber 3) from DEPARTMENT where Dname:dname 4) EXEC SOL DECLARE EMP CURSOR FOR 5) 6) 7) select Ssn, Fname, Minit, Lname, Salary from EMPLOYEE where Dno-anumber FOR UPDATE OF Salaryi 5 8) EXEC SOL OPEN EMP 9) EXEC SOL FETCH from EMP into :ssn, :fname, :minit, :lname, :salary 10) while (SQLcoDE0) printf( "Employee name is:", Fname, Minit, Iname) prompt ("Enter the raise amount: ", raise 12) 13) 14) 15) EXEC SOL update EMPLOYEE set Salary Salary :raise where CURRENT OF EMP 16) 17) EXEC SOL FETCH from EMP into :ssn, :fname, minit, lname, :salary R18) 19) EXEC SQL CLOSE EMP Figure 9.3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
