Oracle存儲(chǔ)過(guò)程簡(jiǎn)單實(shí)例
Oracle存儲(chǔ)過(guò)程簡(jiǎn)單實(shí)例:
一、不帶任何參數(shù)存儲(chǔ)過(guò)程(輸出系統(tǒng)日期)
create or replace procedure output_date is
begin
dbms_output.put_line(sysdate);
end output_date;
二、帶參數(shù)in和out的存儲(chǔ)過(guò)程
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;
上文中通過(guò)實(shí)例的分析,為大家介紹了Oracle數(shù)據(jù)庫(kù)存儲(chǔ)的知識(shí),將具體問(wèn)題形象化,這樣更利于大家去理解學(xué)習(xí),希望上文中涉及到的內(nèi)容對(duì)大家能夠有所幫助。
【編輯推薦】