oracle 包 及 包调用
来源:互联网 发布:软件生存周期 过程 编辑:程序博客网 时间:2024/05/21 10:27
create package testpack --创建一个包头,里面定义变量和方法名称,方法参数,返回值类型
is
v_tax number;
v_s number;
Function tax(v_money number) return number;
function addd(v_a number,v_b number) return number;
end testpack;
create package body testpack --创建包体,里面具体实现包头定义的方法.注意格式
is
function tax(v_money number) return number is
begin
if(v_money<3500) then null;
elsif(v_money>=3500 and v_money<5000) then v_tax := (v_money-3500)*0.03-0;
elsif(v_money>=5000 and v_money<8000) then v_tax := (v_money-3500)*0.1-105;
elsif(v_money>=8000 and v_money<12500) then v_tax := (v_money-3500)*0.2-555;
elsif(v_money>=12500 and v_money<38500) then v_tax := (v_money-3500)*0.25-1005;
elsif(v_money>=38500 and v_money<58500) then v_tax := (v_money-3500)*0.3-2755;
elsif(v_money>=58500 and v_money<83500) then v_tax := (v_money-3500)*0.35-5505;
elsif(v_money>=83500) then v_tax := (v_money-3500)*0.45-13505;
end if;
return v_tax ;
end tax;
function addd(v_a number,v_b number) return number is
begin
v_s := v_a+v_b;
return v_s;
end addd;
end testpack;
---调用方法
declare
v_tax number;
v_s number;
begin
v_tax:= scott.testpack.tax(&input2);
v_s := scott.testpack.addd(&input,&input1);
dbms_output.put_line(v_s);
dbms_output.put_line(v_tax);
end;
is
v_tax number;
v_s number;
Function tax(v_money number) return number;
function addd(v_a number,v_b number) return number;
end testpack;
create package body testpack --创建包体,里面具体实现包头定义的方法.注意格式
is
function tax(v_money number) return number is
begin
if(v_money<3500) then null;
elsif(v_money>=3500 and v_money<5000) then v_tax := (v_money-3500)*0.03-0;
elsif(v_money>=5000 and v_money<8000) then v_tax := (v_money-3500)*0.1-105;
elsif(v_money>=8000 and v_money<12500) then v_tax := (v_money-3500)*0.2-555;
elsif(v_money>=12500 and v_money<38500) then v_tax := (v_money-3500)*0.25-1005;
elsif(v_money>=38500 and v_money<58500) then v_tax := (v_money-3500)*0.3-2755;
elsif(v_money>=58500 and v_money<83500) then v_tax := (v_money-3500)*0.35-5505;
elsif(v_money>=83500) then v_tax := (v_money-3500)*0.45-13505;
end if;
return v_tax ;
end tax;
function addd(v_a number,v_b number) return number is
begin
v_s := v_a+v_b;
return v_s;
end addd;
end testpack;
---调用方法
declare
v_tax number;
v_s number;
begin
v_tax:= scott.testpack.tax(&input2);
v_s := scott.testpack.addd(&input,&input1);
dbms_output.put_line(v_s);
dbms_output.put_line(v_tax);
end;
阅读全文
0 0
- oracle 包 及 包调用
- C#调用ORACLE包
- Oracle包(package的创建,调用)
- java调用oracle包中的存储过程
- C#对Oracle包的调用
- oracle中包的创建和调用
- Oracle 触发器调用包中的存储过程
- Oracle Java Stored Procedure + 包调用
- Mybatis调用Oracle带包存储过程
- Mybatis调用Oracle带包存储过程
- Oracle导入JAR包并调用Java
- Android 中jar包封装及调用>>>>>
- Android中jar包封装及调用
- oracle 包
- oracle包
- ORACLE 包
- oracle包
- Oracle 包
- Android网络通信技术之基于HttpURLConnection的POST/GET传值问题
- shell脚本篇一---shell脚本初步
- android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.a
- 模板类tips
- 1. 给定两个整形变量的值,将两个值的内容进行交换。 2. 不允许创建临时变量,交换两个数的内容(附加题) 3. 求10 个整数中最大值。 4. 写一个函数返回参数二进制中 1 的个数
- oracle 包 及 包调用
- Android中include标签的使用及注意事项
- Linux安装MySQL
- android制作sdk,通过SDK调用另一个应用的方法
- Identifiers:标识符
- vxWorks对于当前(正在运行)任务时间片操作小结
- 图像直方图
- 浏览器对象模型
- 安装pycurl错误