READ Free Dumps For Oracle- 1z0-001
Question ID 8142 | The structure of the DEPT table as: Name Null? Type DEPT NO Not NULL Number(25) DNAME VARCHAR2(14) LOC VARCHAR2(13). Examine the declaration section. DECLARE TYPE dept_record_type is RECORD (dno NUMBER, name VARCHER(20)); dept_rec dept_record_type; How do you retrieve an entire row of the DEPT table using the DEPT-REC variable? |
Option A | SELECT* INTO dept_rec FROM dept WHERE dept no=10; |
Option B | SELECT deptno,dname,loc INTO dept_rec FROM dept WHERE dept no=10; |
Option C | You can't retrieve the entire row using the DEPT_REC variable declared in the code. |
Option D | SELECT* INTO dept_rec.dno,dept_rec.name,dept_rec. FROM dept WHERE dept no=10; |
Correct Answer | C |
Question ID 8143 | Examine the code: DECLARE. CURSOR emp_cursor ISSELECT ename,deptno FROM emp; emp_rec emp_cursor %ROWTYPE BEGIN OPEN emp_cursor LOOP FETCH emp_cursor INTO emp_rec EXIT WHEN emp_cursor NOT FOUND; INSERT INTO temp_emp(name'dno) VALUES(emp_rec.ename,emp_rec deptno); END LOOP; CLOSE emp_cursor; END; Using a cursor FOR loop,which PL/SQL block equivalent to the above code? |
Option A | DECLARE CURSOR emp-cursor 1S SELECT ename,dept no FROM emp; BEGIN FOR emp-rec IN emp-cursor LOOP INSERT INTO temp-emp(name,dno) VALUES (emp-rec.ename, emp-re.deptno); END LOOP END; |
Option B | DECLARE CURSOR emp-cursor 1S SELECT ename,dept no FROM emp; BEGIN FOR emp-rec IN emp-cursor LOOP OPEN emp-cursor; INSERT INTO temp-emp(name,dno) VALUES (emp-rec.ename, emp_rec.deptno); END LOOP END; |
Option C | DECLARE CURSOR emp-cursor 1S SELECT ename,dept no FROM emp; BEGIN FOR emp-rec IN emp-cursor LOOP OPEN emp-cursor; INSERT INTO temp-emp(name,dno) VALUES (emp-rec.ename, emp-re.deptno); END LOOP CLOSE emp-cursor; END |
Option D | DECLARE CURSOR emp-cursor 1S SELECT ename,dept no FROM emp; emp-rec emp-cursor%ROWTYPE; BEGIN FETCH emp-cursor INTO emp-rec; FOR emp-recIN emp-cursor LOOP INSERT INTO temp-emp(name,dno) VALUES (emp-rec.ename, emp-re.deptno); END LOOP END; |
Correct Answer | A |