Hexaware PLSQL Interview Questions
Hexaware PLSQL Interview Questions
Detailed Answers
What is a cursor?
A cursor is a database object used to retrieve, manipulate, and navigate through a result set
row-by-row. It provides control over the context area in memory where SQL statements are
processed.
Explicit Cursor: Manually declared and controlled by the programmer, used for queries that
return multiple rows.
Example:
CURSOR c1 IS SELECT empno, ename FROM emp;
What is package?
A package is a schema object that groups logically related PL/SQL types, variables,
procedures, and functions. It provides modularity and helps in hiding implementation
details.
10g features
- Automatic Storage Management (ASM)
- Flashback Query and Flashback Table
- AWR (Automatic Workload Repository) and ADDM (Automatic Database Diagnostic
Monitor)
- Data Pump Export/Import utilities
- SQL Tuning Advisor and improved optimizer
How to create a table using procedure and how to pass variables for table
Use dynamic SQL with EXECUTE IMMEDIATE inside a procedure to create tables
dynamically.
Example:
EXECUTE IMMEDIATE 'CREATE TABLE ' || v_table_name || '(id NUMBER, name
VARCHAR2(50))';