oracle sample schema 'HR' & 'SCOTT' locate at :
(Package is simply a collection of procedures, functions, package variables, etc)
A package is a schema object that groups logically related PL/SQL types, items, and subprograms. Packages usually have two parts, a specification and a body, although sometimes the body is unnecessary. The specification (spec for short) is the interface to your applications; it declares the types, variables, constants, exceptions, cursors, and subprograms available for use. The body fully defines cursors and subprograms, and so implements the spec. Only the declarations in the package spec are visible and accessible to applications. Implementation details in the package body are hidden and inaccessible. So, you can change the body (implementation) without having to recompile calling programs.
Packaged public variables and cursors persist for the duration of a session. They can be shared by all subprograms that execute in the environment. They let you maintain data across transactions without storing it in the database.
Hot to reference package variable ? packagename.variable_name
1 package global variable. If the variable is defined in the package specification, you could reference it outside the package, as
2. If the variable is defined in the package body, however, you can only reference it from inside another PL/SQL block defined in the package body.
2. reset sequence when it exceed maxvalue:
alter sequence emp_test_seq increment by 1 minvalue 8000 maxvalue 8010 cycle cache 10;
3. different between delete & truncate ?