Oracle存储过程简单实例
2015-11-24 18:06
375 查看
/*不带任何参数存储过程(输出系统日期)*/
create or replace procedure output_date is
begin
dbms_output.put_line(sysdate);
end output_date;
/*带参数in和out的存储过程*/
create or replace procedure get_username(v_id in number,v_username out varchar2)
as
begin
select username into v_username from tab_user where id = v_id; --变量赋值
exception
when no_data_found then
raise_application_error(-20001,'ID不存在!');
end get_username;
create or replace procedure output_date is
begin
dbms_output.put_line(sysdate);
end output_date;
/*带参数in和out的存储过程*/
create or replace procedure get_username(v_id in number,v_username out varchar2)
as
begin
select username into v_username from tab_user where id = v_id; --变量赋值
exception
when no_data_found then
raise_application_error(-20001,'ID不存在!');
end get_username;
相关文章推荐
- oracle decode函数使用方法
- Oracle11g数据库无监听程序解决方案
- Oracle创建临时表:CREATE GLOBAL TEMPORARY TABLE
- Oracle中,日期相加减换算日时分秒
- Oracle常用函数整理
- Oracle体系结构总结
- ORACLE常用Script
- sql: sybase与oracle中insert into select和select into的用法
- Oracle11g 的 error "ORA-01747: user.table.column, table.column 或列说明无效
- java/oracle日期处理-转载
- java/oracle日期处理-转载
- oracle 参数游标和存储过程的结合使用
- sql: sybase 和 oracle 比较
- powerdesigner设计oracle数据库注意事项
- Oracle 开启autotrace功能
- 本人对Oracle Cost Manager模块的一些了解
- oracle 11g用户和密码简介!
- Oracle 10g中UNDO数据的作用及UNDO表空间的常用操作
- Oracle的Flashback用法汇总
- sql:oracle, CURSOR