Oracle:创建存储过程
2017-05-16 15:00
211 查看
1.无参存储过程
create or replace procedure test_proc
as
v_total number(10);
begin
select count(*) into v_total from F_RELATION;
DBMS_OUTPUT.put_line('总人数:'||v_total);
end;
begin
test_proc;
end;
2.有参存储过程
create or replace procedure test_proc(
v_name in VARCHAR2,
anum in varchar2 ,
cid in integer default 100
)
as
v_total number(10);
begin
select count(*) into v_total from F_RELATION;
DBMS_OUTPUT.put_line('总人数:'||v_total||',id='||v_name||',anum='||anum||',cid='||cid);
end;
begin
test_proc('101','this is anum');
end;
create or replace procedure test_proc
as
v_total number(10);
begin
select count(*) into v_total from F_RELATION;
DBMS_OUTPUT.put_line('总人数:'||v_total);
end;
begin
test_proc;
end;
2.有参存储过程
create or replace procedure test_proc(
v_name in VARCHAR2,
anum in varchar2 ,
cid in integer default 100
)
as
v_total number(10);
begin
select count(*) into v_total from F_RELATION;
DBMS_OUTPUT.put_line('总人数:'||v_total||',id='||v_name||',anum='||anum||',cid='||cid);
end;
begin
test_proc('101','this is anum');
end;
相关文章推荐
- Oracle 创建存储过程
- Oracle 9i 数据库 创建数据库 Net 配置 创建表 SQL查询 创建存储过程 (图)
- Oracle--plsql创建存储过程
- Oracle 创建存储过程返回结果集
- 关于Oracle创建存储过程时,访问不同Schema下的表报错:ORA-00942的问题
- Oracle 创建存储过程
- Oracle通用分页存储过程的创建与使用
- 创建oracle的存储过程,以及通过JDBC调用该存储过程
- 比较 sqlserver2005、Oracle PL/SQL创建存储过程
- Oracle创建存储过程、创建函数、创建包
- Oracle 9i 数据库 创建数据库 Net 配置 创建表 SQL查询 创建存储过程 (图)
- oracle 建表 造数据 存储过程 创建数据库的远程连接 以及一列的多行合并
- oracle 存储过程 函数 创建 删除 参数 传递 函数 查看 包 系统包
- Oracle创建存储过程
- Oracle通用分页存储过程的创建与使用
- Oracle 9i 数据库 创建数据库 Net 配置 创建表 SQL查询 创建存储过程 (图)
- Oracle 9i 数据库 创建数据库 Net 配置 创建表 SQL查询 创建存储过程 (图)
- oracle 创建表并创建存储过程,通过存储过程将其他用户的信息导入到新建表中
- Oracle创建序列存储过程
- oracle执行存储过程_oracle创建存储过程