Answer to Question #272354 in C++ for sam

Question #272354

1. Write a PL/SQL code to print all tables up to a number fetched from a table using implicit cursors.


1
Expert's answer
2021-11-27T11:34:43-0500
/*using empoyee table as example*/ 
BEGIN
    FOR emprec IN(SELECT department_name,
                       d.department_id,
					   first_name,
                       last_name,
                       job_id,
                       salary
                FROM   departments d
                       join employees e
                         ON e.department_id = d.department_id
                WHERE  job_id = 'ST_CLERK'
                       AND salary > 3000) LOOP
        dbms_output.Put_line('Name: '
		                     ||emprec.first_name
                             ||' '
							 ||emprec.last_name||chr(9)
							 ||' Department: '
                             ||emprec.department_name||chr(9)
                             ||' Department ID: '
                             ||emprec.department_id||chr(9)
                             ||' Job ID: '
                             ||emprec.job_id||chr(9)
                             ||' Salary: '
                             ||emprec.salary);
    END LOOP;
END; 


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS