Anda di halaman 1dari 1

The pragma EXCEPTION_INIT associates an exception name with an Oracle error number.

cursor c_lock is select ename from emp for update of ename nowait ; r_lock c_lock%rowtype; e_resource_busy exception; pragma exception_init(e_resource_busy,-54); begin open c_lock; .. do something... exception when <b>e_resource_busy</b> then ... ORA-00054 has occurred; table is locked.

end;
RESTRICT_REFERENCES Pragma To be callable from SQL statements, a stored function must obey certain "purity" rules, which are meant to control side effects. (See "Controlling Side Effects of PL/SQL Subprograms".) If any SQL statement inside the function body violates a rule, you get an error at run time (when the statement is parsed). To check for violations of the rules, you can use the pragma (compiler directive) RESTRICT_REFERENCES. The pragma asserts that a function does not read and/or write database tables and/or package variables. SERIALLY_REUSABLE Pragma The pragma SERIALLY_REUSABLE indicates that the package state is needed only for the duration of one call to the server (for example, a PL/SQL anonymous block, an OCI call to the database or a stored procedure call through a database link). After this call, the storage for the package variables can be reused, reducing the memory overhead for long-running sessions.

SQL LOADER:
load data infile '/home/ramesh/employee.txt' into table employee fields terminated by ","

( id, name, dept, salary )

Anda mungkin juga menyukai