uUse SELECT INTO correctly.
ØYour query might return more than one row, or no rows at all.
ØMust include exception handlers if there is any possibility of them occurring.
ØCode might execute correctly for many months before some unusual condition shows up that causes it to fail.
ØBULK COLLECT clause
§Check for the number of fetched records
§Exception NO_DATA_FOUND
is never raised, even when no
rows were fetched.
uDo not assume column order in DML statements.
ØExplicitly list the columns you are referencing.
ØColumns that are added to a table later will break your code.
ØRebuilding your database might result in the default column order being changed.
ØUse variables of type RECORD
§Do not have to list anything in the INSERT statement because you are inserting a variable into the table that is defined as a row from the same table.
§No chance for inconsistency.
§Easier way of passing data to different routines.