--創(chuàng)建表create ?table ?text(sid ? number ?not null ?primary key,sname ?varchar(10),school ?varchar(10))--創(chuàng)建新增create ?or replace ?procedure ?proc_insert(i_sid in number,i_sname in ?varchar2,i_school in ?varchar2)isbegininsert ?into scott.text(sid,sname,school) values(i_sid,i_sname,i_school);commit;end;--調(diào)用call proc_insert(110,'靜靜','hello');--創(chuàng)建更新create or replace procedure proc_update(u_sid ?in nummber,u_sname ?varchar2,u_school ?varchar2)isbeginupdate scott.text ?set sname=u_sname,school=u_school where sid=u_sid;end;--調(diào)用call proc_update(110,'靜靜啊','紙張');--創(chuàng)建查詢create or replace procedure proc_select(s_sid in number)iss_sname ?varchar2;s_school ?varchar2;beginselect sname,school into ?s_sname,s_school ?from scott.text ?where sid=s_sid;end;--調(diào)用call proc_select(110);--創(chuàng)建刪除create or replace ?procedure proc_delete(d_sid in number)isbegindelete from scott.text ?where sid=d_sid;end;--調(diào)用call proc_delete(110);這樣寫對(duì)么
- 1 回答
- 0 關(guān)注
- 2282 瀏覽
添加回答
舉報(bào)
0/150
提交
取消