建立資料庫序列 mysql mysql建立資料庫!

2021-10-17 22:10:29 字數 966 閱讀 6279

mysql的儲存過程沒寫過,給你個oracle版本的你參考著寫吧,格式都差不多,這裡面its_kk是我oracle的使用者名稱,getuserid是這個procedure的名字,其中stryhdm是儲存過程中所用到的輸入引數,你這兒可能得寫倆引數,乙個是學號乙個是答案資訊,具體型別看你資料要求,至於這裡的out_ret是輸出引數,是你儲存過程中產生的值,一般用來在程式裡利用這個值來判斷輸入的成功與否或者進行其他的判斷操作。你這裡加不加就看你自己需要了

gid_temp varchar2(7);

mid_temp number;

這倆是臨時變數,用來儲存中間計算出來的值,其他還有看不懂的再問吧

create or replace procedure its_kk.getuserid(

stryhdm in varchar,

out_ret out integer

) is

gid_temp varchar2(7);

mid_temp number;

begin

select gid into gid_temp from vio_groupuser where yid=stryhdm;

if(gid_temp=null) then

out_ret :=2;

else

select count(mid) into mid_temp from vio_groupmenu where gid=gid_temp and mid='0104';

if(mid_temp=0) then

out_ret := 2;

else

out_ret :=1;

end if;

end if;

exception

when no_data_found then

null;

when others then

raise;

end getuserid;

資料庫建立

刪除資料庫 drop database cpxs 資料庫操作語法 建立資料庫 create database database name on 子句 資料檔案屬性 primary 指定主檔案,否則預設第乙個 n 檔案屬性 filegrowth growth increament n 檔案組 log ...

建立資料庫

1.建立表空間 create tablespace test space logging datafile f oracle oracledata test.ora size 5m extent management local uniform segment space management au...

建立資料庫

建立乙個資料庫 binbin 有乙個主要資料庫檔案 bin.mdf 乙個次要資料庫檔案組 jay 裡面有次要資料檔案 jay 1.ndf,jay 2.ndf 乙個日誌文志檔案 ziji.ldf 判斷是否存在此資料庫,若存在就刪除 if exists select from sysdtabases w...