当前位置:Linux教程 - Linux资讯 - 在Linux机器上安装运行Oracle(下)

在Linux机器上安装运行Oracle(下)

PL/SQL

  对SQL的过程性语言扩展(PL/SQL)可能是Oracle最著名的特点。这种强大的专业数据库管理语言允许您对声明性的SQL加逻辑控制。

  一般,PL/SQL的存储过程(stored procedure)用命令行的sqlplus,图形化的Developer/2000(Linux上目前还没有)或其他工具开发,允许您从Oracle众多的查询接口(Oracle Application Server, Python, Perl,JDBC 或者C)访问。

程序3:

create or replace package stored_sample as
function get_annual_salary (emp_number in number) return number;
end stored_sample;
/
create or replace package body stored_sample as
function get_annual_salary (emp_number in number) return number
is
annual_salary number;
monthly_salary number;
begin
select sal into monthly_salary from emp where empno = emp_number;
annual_salary := monthly_salary * 24;
return (annual_salary);
end get_annual_salary;
end stored_sample;
/

  上面的程序3是存储进程的一个小示范,它接受一个员工号,返回该员工的年薪。相关的函数get_annual_salary封装在PL/SQL包sample_package中。
更多内容请看Linux安装  Linux安装  linux系统安装专题,或

(出处:http://www.sheup.com)