您的位置:首页 > 数据库 > Oracle

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: