AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


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
Explanation Explanation/Reference: Explanation: Answer C is correct because using declared DEPT_REC variable you cannot retrieve the entire row. Incorrect Answers: A: This syntax is used to populate variables, not records with data from the table. B: This syntax cannot be also used to populate DEPT_REC variable. D: This syntax cannot be also used to populate DEPT_REC variable. Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 211-213 Chapter 5: Introducing PL/SQL


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
Explanation Explanation/Reference: Explanation: Answer A is correct because for cursor for loop you don't need explicitly open cursor, fetch data and close cursor, it works automatically by definition of a cursor for loop. Incorrect Answers: B: You don't need to open cursor if you use cursor FOR LOOP. C: You don't need to open and close cursor if you use cursor FOR LOOP. D: You don't need to fetch data into the cursor if you use cursor FOR LOOP. Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 233-234 Chapter 5: Introducing PL/SQL

Send email to admin@getfreedumps for new dumps request!!!