Oracle的儲存過程基本寫法

2022-09-19 09:27:10 字數 486 閱讀 9182

create [or replace] procedure 儲存過程名(param1 in type,param2 out type)

as變數1 型別(值範圍);

變數2 型別(值範圍);

begin

select count(*) into 變數1 from 表a where列名=param1;

if (判斷條件) then

select 列名 into 變數2 from 表a where列名=param1;

dbms_output.put_line('列印資訊');

elsif (判斷條件) then

dbms_output.put_line('列印資訊');

else

raise 異常名(no_data_found);

end if;

exception

when others then

rollback;

end;

oracle儲存過程(寫法 實戰)

create or replace procedure p add num1 in number,num2 in number,result out number 引數,可為空 as result number 這裡還可以定義變數 begin result num1 num2 執行過程體 end 引...

儲存過程寫法

引用 儲存過程呼叫 drop procedure if exists pro rep shadow rs delimiter rep shadow rs 用來處理資訊的增加,更新和刪除 每次只更新上次以來沒有做過的資料 根據不同的標誌位 需要乙個輸出的引數,如果返回為0,則呼叫失敗,事務回滾 如果返...

儲存過程寫法

引用 儲存過程呼叫 drop procedure if exists pro rep shadow rs delimiter rep shadow rs 用來處理資訊的增加,更新和刪除 每次只更新上次以來沒有做過的資料 根據不同的標誌位 需要乙個輸出的引數,如果返回為0,則呼叫失敗,事務回滾 如果返...