PACKAGE

oracle sample schema 'HR' & 'SCOTT' locate at :

http://code.google.com/p/adf-samples-demos/downloads/detail?name=demoscripts.zip&can=2&q=

1. Package

(Package is simply a collection of procedures, functions, package variables, etc)

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.

Package variable

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 packge_name.variable_name.

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.

 

http://docs.oracle.com/cd/B10501_01/appdev.920/a96624/09_packs.htm

 

 

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 ?

http://www.orafaq.com/faq/difference_between_truncate_delete_and_drop_commands

 

4. callback

http://docs.oracle.com/cd/E16184_01/dev.837/e12886/c07_callbacks.htm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值