第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Oracle數(shù)據(jù)庫(kù)開(kāi)發(fā)必備利器之PL/SQL基礎(chǔ)

難度初級(jí)
時(shí)長(zhǎng) 3小時(shí)22分
學(xué)習(xí)人數(shù)
綜合評(píng)分9.57
115人評(píng)價(jià) 查看評(píng)價(jià)
9.8 內(nèi)容實(shí)用
9.4 簡(jiǎn)潔易懂
9.5 邏輯清晰
狀態(tài): 失敗 -測(cè)試失敗: IO 錯(cuò)誤: Undefined Error
結(jié)束了,謝謝老師!第三次看了,感謝老師
set serveroutput on
declare
cursor cemp(dno number) is select ename from emp where empno=dno;
pename emp.ename%type;

begin
open cemp(10);
LOOP
fetch cemp into pename;
exit when cemp%notfound;
dbms_output.put_line(pename);
end loop;

close cemp;
end;
/
為啥我沒(méi)有結(jié)果
光標(biāo)又叫做游標(biāo),代表了一個(gè)結(jié)果集。好比是jdbc中的Result Set集
代碼段三:
close emp_cursor;
dbms_output.put_line('漲工資人數(shù) 工資總額');
dbms_output.put_line(rpad(countsum,8,' ')||' '||rpad(totalsal,8,' '));
end;
代碼段二:
loop
exit when totalsal>50000;
fetch emp_cursor into cempno,csal ;
exit when emp_cursor%notfound;
if totalsal+csal*0.1<=50000 then --這一句很關(guān)鍵,如果沒(méi)有這個(gè)判斷的話,總工資可能會(huì)超過(guò)5萬(wàn)。
update emp set sal=sal*1.1 where empno=cempno;
countsum:=countsum+1;
totalsal:=totalsal+csal*0.1;
end if;
end loop;
commit;
由于一次不能發(fā)表超過(guò)300個(gè)字,所以只能分散發(fā)布了:
代碼段一:
set serveroutput on;
declare
cursor emp_cursor is
select empno,sal from emp order by sal asc;
countsum number :=0;
totalsal emp.sal%type;
cempno emp.empno%type;
csal emp.sal%type;

begin
select sum(sal) into totalsal from emp;
open emp_cursor;
按照老師的思路,我編寫(xiě)了如下代碼:修正了總工資超過(guò)五萬(wàn)的小bug,運(yùn)行之后沒(méi)有問(wèn)題,各位可以借鑒一下,如果有更好的方法歡迎交流,謝謝:
我用sqldeveloper建立sys、system等可以連接,但是scott賬戶不行,提示scott賬戶鎖定??墒俏以赑L/SQL上可以連接,scott的確也解鎖了、
漲工資……(漲工資)……((漲工資))…………
loop
exit when countsal > 50000;
fetch cemp into pempno,psal;
exit when cemp%notfound;
exit when (countsal+psal*0.1) > 50000;
教程非常好、謝謝老師。
課程須知
親,要學(xué)習(xí)本門(mén)課程只需要熟練使用Oracle的SQL語(yǔ)句就可以了,可以參考慕課網(wǎng)的課程《Oracle數(shù)據(jù)庫(kù)開(kāi)發(fā)必備利器之SQL基礎(chǔ)》呦!
老師告訴你能學(xué)到什么?
1、能夠熟練掌握PL/SQL的基本語(yǔ)法 2、能夠熟練使用光標(biāo)和例外 3、能夠熟練使用PL/SQL進(jìn)行開(kāi)發(fā)

微信掃碼,參與3人拼團(tuán)

微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

友情提示:

您好,此課程屬于遷移課程,您已購(gòu)買(mǎi)該課程,無(wú)需重復(fù)購(gòu)買(mǎi),感謝您對(duì)慕課網(wǎng)的支持!

本次提問(wèn)將花費(fèi)2個(gè)積分

你的積分不足,無(wú)法發(fā)表

為什么扣積分?

本次提問(wèn)將花費(fèi)2個(gè)積分

繼續(xù)發(fā)表請(qǐng)點(diǎn)擊 "確定"

為什么扣積分?

舉報(bào)

0/150
提交
取消