InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 101. |
Explain The Functionality Of Utl_http Package ? |
|
Answer» The UTL_HTTP PACKAGE enables PL/SQL and SQL to access the INTERNET data using the REQUEST and REQUEST_PIECES functions. These functions take the UNIFORM Resource Locator (URL) of the WEBSITE as input and return the HyperText MARKUP Language (HTML) data from the website. The UTL_HTTP package enables PL/SQL and SQL to access the Internet data using the REQUEST and REQUEST_PIECES functions. These functions take the Uniform Resource Locator (URL) of the website as input and return the HyperText Markup Language (HTML) data from the website. |
|
| 102. |
What Is The Difference Between Fopen And Is_open Functions? |
|
Answer» The difference between FOPEN and IS_OPEN functions is GIVEN as follows: IS_OPEN — Returns a Boolean value when the file handle is PASSED as a parameter to the function to an open file. Following is the syntax of the IS_OPEN function: The difference between FOPEN and IS_OPEN functions is given as follows: IS_OPEN — Returns a Boolean value when the file handle is passed as a parameter to the function to an open file. Following is the syntax of the IS_OPEN function: |
|
| 103. |
Can The Utl_file Package Raise Predefined Pl/sql Error? |
|
Answer» YES, the UTL_FILE PACKAGE can RAISE PREDEFINED EXCEPTIONS, such as NO_DATA_FOUND or VALUE_ERROR. Yes, the UTL_FILE package can raise predefined exceptions, such as NO_DATA_FOUND or VALUE_ERROR. |
|
| 104. |
Name A Few Exceptions Of The Utl_file Package ? |
|
Answer» A few EXCEPTIONS of the UTL_FILE package are as follows:
A few exceptions of the UTL_FILE package are as follows: |
|
| 105. |
What Is The Use Of Fflush Procedure Of The Utl_file Package? |
|
Answer» The FFLUSH PROCEDURE is USED to write all DATA buffered in MEMORY to a file. The FFLUSH procedure is used to write all data buffered in memory to a file. |
|
| 106. |
What Is The Difference Between The Put_line And Putf Functions Of The Utl_file Package? |
|
Answer» The difference between the PUT_LINE and PUTF functions of the UTL_FILE package is as follows:
The difference between the PUT_LINE and PUTF functions of the UTL_FILE package is as follows: |
|
| 107. |
How Can All The Directories Be Made Available To The Utl_file Package? |
|
Answer» The following SETTINGS will turn off all the database permissions on the DIRECTORIES that are accessible to the database PROCESSES and make all of them AVAILABLE to the UTL_FILE PACKAGE: The following settings will turn off all the database permissions on the directories that are accessible to the database processes and make all of them available to the UTL_FILE package: |
|
| 108. |
What Is Essential To Be Set In The Init.ora File Before Using The Utl_file Package? |
|
Answer» It is essential to initialize the UTL_FILE_DIR PARAMETER in the init.ora file before USING the UTL_FILE PACKAGE. This parameter is initialized to the directory that is to be ACCESSED as follows: It is essential to initialize the UTL_FILE_DIR parameter in the init.ora file before using the UTL_FILE package. This parameter is initialized to the directory that is to be accessed as follows: |
|
| 109. |
What Is The Utl_file Package? |
|
Answer» The UTL_FILE PACKAGE PROVIDES TEXT files input/output functionality within PL/SQL. The security on client-side is handled USING normal operating system file permissions; whereas, server-side security is handled though restrictions on the directories that are ACCESSED. The UTL_FILE package provides text files input/output functionality within PL/SQL. The security on client-side is handled using normal operating system file permissions; whereas, server-side security is handled though restrictions on the directories that are accessed. |
|
| 110. |
How Can The Dbms_output Package Used To Get An Array Of Lines From Buffer Into The Procedure? |
|
Answer» The DBMS_OUTPUT package uses the GET_LINES PROCEDURE to GET an array of LINES from OUTPUT buffer into the procedure. The DBMS_OUTPUT package uses the GET_LINES procedure to get an array of lines from output buffer into the procedure. |
|
| 111. |
What Is The Use Of Dbms_output Package? |
|
Answer» The DBMS_OUTPUT PACKAGE is used to DISPLAY OUTPUT messages from the PL/SQL block. The DBMS_OUTPUT package is used to display output messages from the PL/SQL block. |
|
| 112. |
Which Data Dictionary View Is Used To See The Status Of Currently Running Jobs? |
|
Answer» The DBA_JOBS_RUNNING data DICTIONARY view is used to display the status of the jobs CURRENTLY running. The DBA_JOBS_RUNNING data dictionary view is used to display the status of the jobs currently running. |
|
| 113. |
Which Data Dictionary View Is Used To See The Status Of Submitted Jobs? |
|
Answer» The DBA_JOBS data DICTIONARY VIEW is used to DISPLAY the status of the SUBMITTED jobs. The DBA_JOBS data dictionary view is used to display the status of the submitted jobs. |
|
| 114. |
Is It Possible To Run A Job Scheduled For A Particular Time To Be Run Immediately? If Yes, Then How? |
|
Answer» YES, It is possible to run a job SCHEDULED for a particular TIME IMMEDIATELY using the DBMS_JOB.RUN PROCEDURE. Yes, It is possible to run a job scheduled for a particular time immediately using the DBMS_JOB.RUN procedure. |
|
| 115. |
Give A Statement In Which The Dbms_job.change Procedure Is Used To Change The Backup Job Submitted To Morning 8am And Above ? |
|
Answer» The JOB can be RESCHEDULED as FOLLOWS: The job can be rescheduled as follows: |
|
| 116. |
What Is Use Of The Dbms_job.next_date Parameter? |
|
Answer» The DBMS_JOB.NEXT_DATE parameter is used to RESCHEDULE a PARTICULAR JOB. This parameter is used when the next execution DATE for a particular job needs to be changed. The DBMS_JOB.NEXT_DATE parameter is used to reschedule a particular job. This parameter is used when the next execution date for a particular job needs to be changed. |
|
| 117. |
When Is An Exception Raised By The Dbms_job Package? |
|
Answer» An exception is RAISED if the time specified for the JOB does not EVALUATE to a job in future. An exception is raised if the time specified for the job does not evaluate to a job in future. |
|
| 118. |
Provide A Program Code In Which The Dbms_job.submit Procedure Is Used To Schedule A Database Backup Job In The Queue For Midnight ? |
|
Answer» The following program code is used to schedule a database backup JOB USING the procedure pk_db_activities.proc_db_backup in the queue for MIDNIGHT: The following program code is used to schedule a database backup job using the procedure pk_db_activities.proc_db_backup in the queue for midnight: |
|
| 119. |
Give The Parameters Of The Dbms_job.submit Procedure ? |
|
Answer» The DBMS_JOB.SUBMIT procedure adds a new job to the job queue. It TAKES four PARAMETERS as input and returns the job number as the output though the JOB parameter. The parameters of the DBMSJOB.SUBMIT procedure are as follows:
The DBMS_JOB.SUBMIT procedure adds a new job to the job queue. It takes four parameters as input and returns the job number as the output though the JOB parameter. The parameters of the DBMSJOB.SUBMIT procedure are as follows: |
|
| 120. |
Which Procedure Of The Dbms_job Package Is Used To Disable The Execution Of A Particular Job? |
|
Answer» The DBMS_JOB.BROKEN procedure DISABLES the EXECUTION of the specified JOB. This job will not be executed by the Oracle server. The DBMS_JOB.BROKEN procedure disables the execution of the specified job. This job will not be executed by the Oracle server. |
|
| 121. |
Which Are The Subprograms Of The Dbms_job Package? |
|
Answer» The subprograms of the DBMS_JOB package are as FOLLOWS:
The subprograms of the DBMS_JOB package are as follows: |
|
| 122. |
Which Oracle Package Is Used For Scheduling Job? |
|
Answer» The DBMS_JOB PACKAGE is USED for SCHEDULING and EXECUTING PL/SQL PROGRAMS. The DBMS_JOB package is used for scheduling and executing PL/SQL programs. |
|
| 123. |
Give The Usage Of Dbms_ddl Package ? |
|
Answer» The DBMSJDDL package provides access to CERTAIN DDL STATEMENTS within PL/SQL blocks. This package runs with the privileges of the CALLING user and not the OWNER of the SYS package. Some of the procedures included in this package are as follows:
The DBMSJDDL package provides access to certain DDL statements within PL/SQL blocks. This package runs with the privileges of the calling user and not the owner of the SYS package. Some of the procedures included in this package are as follows: |
|
| 124. |
What Is The Use Of Execute Immediate Command? Explain With Example ? |
|
Answer» The native dynamic SQL can be executed within a PL/SQL block USING the EXECUTE IMMEDIATE command, as shown in the following EXAMPLE: The native dynamic SQL can be executed within a PL/SQL block using the EXECUTE IMMEDIATE command, as shown in the following example: |
|
| 125. |
Are The Pl/sql Specific Datatypes Supported By Dynamic Sql To Define Variables And Bind Arguments? |
|
Answer» No, PL/SQL datatypes are not supported by DYNAMIC SQL; only PL/SQL RECORD DATATYPE can be used in the INTO clause. No other PL/SQL datatype, such as BOOLEAN, can be used WITHIN dynamic SQL. No, PL/SQL datatypes are not supported by dynamic SQL; only PL/SQL RECORD datatype can be used in the INTO clause. No other PL/SQL datatype, such as BOOLEAN, can be used within dynamic SQL. |
|
| 126. |
Does Dynamic Sql Support All Sql Data Types? |
|
Answer» Yes, dynamic SQL SUPPORTS all SQL data types. It is possible to define variables and bind arguments of COLLECTION type, LOBS, and REFs. Yes, dynamic SQL supports all SQL data types. It is possible to define variables and bind arguments of collection type, LOBs, and REFs. |
|
| 127. |
What Is The Use Of Dbms_sql Package? |
|
Answer» The DBMS_SQL package is used to ACCESS dynamic SQL and dynamic PL/SQL from WITHIN a PL/SQL program. It allows you to execute statements that are otherwise impossible from within PL/SQL programs, which includes DDL, DCL, or TRANSACTION CONTROL statements. The DBMS_SQL package is used to access dynamic SQL and dynamic PL/SQL from within a PL/SQL program. It allows you to execute statements that are otherwise impossible from within PL/SQL programs, which includes DDL, DCL, or Transaction Control statements. |
|
| 128. |
How Is An Sql Statement Processed? What Are The Steps That An Sql Statement Undergoes For Compilation? |
|
Answer» SQL STATEMENTS are compiled using the following steps:
SQL statements are compiled using the following steps: |
|
| 129. |
What Is Dynamic Sql And What Is Its Usage? |
|
Answer» Dynamic SQL is used by PL/SQL to EXECUTE Data DEFINITION Language (DDL) statements, Data Control (DCL) statements, or Transaction Control statements within PL/SQL blocks. These statements are not stored within the source CODE but are stored as character variables in the program. The SQL statements are created dynamically at RUNTIME by using variables. This is used either using native dynamic SQL or through the DBMS_SQL package. Dynamic SQL is used by PL/SQL to execute Data Definition Language (DDL) statements, Data Control (DCL) statements, or Transaction Control statements within PL/SQL blocks. These statements are not stored within the source code but are stored as character variables in the program. The SQL statements are created dynamically at runtime by using variables. This is used either using native dynamic SQL or through the DBMS_SQL package. |
|
| 130. |
What Is Catproc.sql? |
|
Answer» The catproc.sql is a SQL file, which has the script to create packages in the DATABASE, This file has to be EXECUTED on the SQL PROMPT for the packages to be available in the database. The catproc.sql is a SQL file, which has the script to create packages in the database, This file has to be executed on the SQL prompt for the packages to be available in the database. |
|
| 131. |
What Are Oracle Supplied Packages? |
|
Answer» Oracle server provides the Oracle Supplied Packages to ALLOW PROCEDURAL Language/Structured Query Language (PL/SQL) to access certain FEATURES of SQL, which are not available in PL/SQL. They also help in EXTENDING the functionality of the database. Oracle server provides the Oracle Supplied Packages to allow Procedural Language/Structured Query Language (PL/SQL) to access certain features of SQL, which are not available in PL/SQL. They also help in extending the functionality of the database. |
|
| 132. |
What Is The Meaning Of Pragma Keyword? |
|
Answer» The PRAGMA KEYWORD SIGNIFIES that the STATEMENT is a compiler directive, which is not processed when the PL/SQL is executed. It is a pseudo-instruction that tells the compiler to interpret all the occurrences of EXCEPTION name within the block with the associated ORACLE server number. The PRAGMA keyword signifies that the statement is a compiler directive, which is not processed when the PL/SQL is executed. It is a pseudo-instruction that tells the compiler to interpret all the occurrences of exception name within the block with the associated Oracle server number. |
|
| 133. |
What Is The Difference Between Raise And Raise_application_error? |
Answer»
|
|
| 134. |
What Is The Difference Between User-defined Exceptions And Oracle-defined Exceptions? |
|
Answer» User-defined EXCEPTIONS are explicitly RAISED; WHEREAS, ORACLE- defined exceptions are raised implicitly. User-defined exceptions are explicitly raised; whereas, Oracle- defined exceptions are raised implicitly. |
|
| 135. |
What Happen When There Is No Handler For A Raised Exception? |
|
Answer» If an exception is raised and there is no handler in the current block, the exception WOULD PROPAGATE to the enclosing block. If no handler is FOUND in the enclosing block, the exception will be propagated to the CALLING environment as an UNHANDLED exception. If an exception is raised and there is no handler in the current block, the exception would propagate to the enclosing block. If no handler is found in the enclosing block, the exception will be propagated to the calling environment as an unhandled exception. |
|
| 136. |
What Is The Advantage Of Having A Separate Exception Section Within A Pl/sql Code? |
|
Answer» The ADVANTAGES of having a separate EXCEPTION section within a PL/SQL CODE are as follows:
The advantages of having a separate exception section within a PL/SQL code are as follows: |
|
| 137. |
When Is The Row_type_mismatch Exception Raised? |
|
Answer» The ROW__TYPE_MISMATCH EXCEPTION is RAISED when a host cursor variable and a PL/SQL cursor variable INVOLVED in an assignment have incompatible RETURN types. The ROW__TYPE_MISMATCH exception is raised when a host cursor variable and a PL/SQL cursor variable involved in an assignment have incompatible return types. |
|
| 138. |
When Is The Cursor_already_open Exception Raised? |
|
Answer» This EXCEPTION is RAISED when the program TRIES to open an already opened CURSOR. The cursor should be closed before it can be opened again. This exception is raised when the program tries to open an already opened cursor. The cursor should be closed before it can be opened again. |
|
| 139. |
Where Will The Control Be Transferred If An Exception Is Raised Within An Exception Section Of The Block? |
|
Answer» When an EXCEPTION is raised WITHIN an exception section of a BLOCK, the control is transferred to the exception section of the ENCLOSING block. When an exception is raised within an exception section of a block, the control is transferred to the exception section of the enclosing block. |
|
| 140. |
How Can A Current Exception Be Re-raised? |
|
Answer» The RAISE statement can be used to re-raise the current EXCEPTION. It STOPS the normal execution of a PL/SQL program and transfers the CONTROL to an exception handler, as SHOWN in the following code: The RAISE statement can be used to re-raise the current exception. It stops the normal execution of a PL/SQL program and transfers the control to an exception handler, as shown in the following code: |
|
| 141. |
What Causes The Invalid_cursor Exception? |
|
Answer» This exception is RAISED when the program attempts to perform an illegal OPERATION, such as closing an UNOPENED CURSOR. This exception is raised when the program attempts to perform an illegal operation, such as closing an unopened cursor. |
|
| 142. |
Does Raise_application_error Overwrite The Error Stack Or Append Messages To The Error Stack? |
|
Answer» The default behavior of the RAISE_APPLICATION_ERROR procedure is to overwrite the error message stack. However, if the parameter is PASSED, then the MESSAGES can be appended to the error stack as well. Following is the syntax of the RAISE_APPLICATION_ERROR procedure: In the preceding syntax, TRUE adds the messages to the error stack; whereas, FALSE overwrites the error stack. The default behavior of the RAISE_APPLICATION_ERROR procedure is to overwrite the error message stack. However, if the parameter is passed, then the messages can be appended to the error stack as well. Following is the syntax of the RAISE_APPLICATION_ERROR procedure: In the preceding syntax, TRUE adds the messages to the error stack; whereas, FALSE overwrites the error stack. |
|
| 143. |
How Can A Transaction Be Retried After An Exception? |
|
Answer» The following method can be used to RETRY a transaction after an exception is raised:
The following method can be used to retry a transaction after an exception is raised: |
|
| 144. |
Can Processing Be Resumed From The Point Exception Was Raised After The Exception Is Handled? |
|
Answer» After the exception is handled, processing cannot be resumed within the EXECUTABLE section of the current block from where the exception was raised. The current block where the exception handler is DECLARED will be terminated. The control will pass to the STATEMENT in the enclosing executable block. If there is no enclosing block, control will pass BACK to the calling host environment. After the exception is handled, processing cannot be resumed within the executable section of the current block from where the exception was raised. The current block where the exception handler is declared will be terminated. The control will pass to the statement in the enclosing executable block. If there is no enclosing block, control will pass back to the calling host environment. |
|
| 145. |
What Happens If An Exception Is Not Handled In A Sub- Block? |
|
Answer» If an EXCEPTION is not HANDLED in a sub-block, the exception propagates to the enclosing blocks until the associated handler is FOUND. If none of the blocks has a handler for the exception, an unhandled exception ERROR is passed BACK to the host environment as follows: If an exception is not handled in a sub-block, the exception propagates to the enclosing blocks until the associated handler is found. If none of the blocks has a handler for the exception, an unhandled exception error is passed back to the host environment as follows: |
|
| 146. |
Can Raise_application_error Be Called In The Executable Section Of The Program Unit? |
|
Answer» YES, the RAISE_APPLICATION_ERROR procedure can be called in the executable SECTION as WELL as the EXCEPTION section of the PL/SQL code. Yes, the RAISE_APPLICATION_ERROR procedure can be called in the executable section as well as the exception section of the PL/SQL code. |
|
| 147. |
What Happens After A Sub-block Handles An Exception? |
|
Answer» When a sub-block HANDLES an exception, the CONTROL passes to the NEXT statement in the executable section of the enclosing block immediately after the END statement of the sub-block. When a sub-block handles an exception, the control passes to the next statement in the executable section of the enclosing block immediately after the END statement of the sub-block. |
|
| 148. |
What Happens To The Program Control When The Raise_application_error Procedure Is Encountered? |
|
Answer» When the RAISE_APPLICATION_ERROR PROCEDURE is encountered, it ends the PROGRAM UNIT and RETURNS the error number and message to the application. The error number and message can be trapped LIKE any Oracle error. When the RAISE_APPLICATION_ERROR procedure is encountered, it ends the program unit and returns the error number and message to the application. The error number and message can be trapped like any Oracle error. |
|
| 149. |
How Are User-defined Exceptions Trapped? |
|
Answer» User-defined EXCEPTIONS are defined in the declarative section of the PL/SQL code and raised EXPLICITLY USING the RAISE statement, as shown in the FOLLOWING code snippet: User-defined exceptions are defined in the declarative section of the PL/SQL code and raised explicitly using the RAISE statement, as shown in the following code snippet: |
|
| 150. |
How Can The Sqlcode And Sqlerrm Functions Be Used For Exception Handling? |
|
Answer» These functions can be used with the OTHERS exception handler to GET the error number and the error MESSAGE that has CAUSED the OTHERS exception to be raised, as shown in the following code SNIPPET; These functions can be used with the OTHERS exception handler to get the error number and the error message that has caused the OTHERS exception to be raised, as shown in the following code snippet; |
|