Database-Oracle [3i Infotech Placement]: Sample Questions 56 - 57 of 132

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 56

Question MCQ▾

Is it possible to open a cursor which is in a Package in another procedure?

Choices

Choice (4)

a.

Yes

b.

No

c.

None of the above

d.

All of the above

Edit

Answer

a.

Explanation

Steps of Creating Cursors in Oracle
  • Yes, it is possible to open a cursor, which is in a Package in another procedure. Cursor:
  • Declared in a package specification- is global and can be accessed by other procedures or procedures in a package.
  • Declared in a procedure- is local to the procedure that cannot be accessed by other procedures.
  • Is declared in the declaration part.
  • Declaration section cannot assign the value to variable.

Question 57

Question MCQ▾

If an UNIQUE KEY constraint on DATE column is created, will it accept the rows that are inserted with SYSDATE?

Choices

Choice (4)

a.

won՚t

b.

Will

c.

All of the above

d.

None of the above

Edit

Answer

a.

Explanation

UNIQUE KEY and Primary Key Constrain
  • If an UNIQUE KEY constraint on DATE column is created, it won՚t accept the rows that are inserted with SYSDATE.
  • A unique key defined on a column which has date as the data type- then one cannot insert the same date more than once.
  • A SYSDATE has certain resolution, rows inserted more frequently will come out with same value for the date column and hence would fail.

SYSDATE

Syntax

SYSDATE

Parameter

The function requires no parameters.

Example

SELECT TO_CHAR

(SYSDATE, ‘MM-DD-YYYY HH24: MI: SS’ ) “NOW”

FROM DUAL;

O/P

08 - 12 - 2005 09: 45: 51