[DECLARE]
--declaration statements (optional)
BEGIN
--execution statements
[EXCEPTION]
--exception handling statements (optional)
END;​
CHAR, DATE, LONG, VARCHAR2, NUMBER, BOOLEAN
are some examples of scalar data types.RECORD, TABLE, VARRAY
, and so on.REF, CURSOR
is an example of a reference data type.BLOB, BFILE, CLOB, NCLOB
, and others are examples of large object data types.UPDATE table_name SET field=new_value WHERE CURRENT OF cursor_name
% ROWTYPE
is used when a query returns an entire row of a table or view.TYPE RECORD
, on the other hand, is used when a query returns column of different tables or views.TYPE r_emp is RECORD (sno smp.smpno%type,sname smp sname %type)
%ROWTYPE
smpno,dept from smp;
%ROWTYPE