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

為了賬號安全,請及時綁定郵箱和手機立即綁定

請看一下哪里出問題了

set serveroutput on;

declare

? ? cursor cemp is select to_char(hiredate, 'yyyy') from emp;

? ? phiredate varchar2(4);

? ? count80 number := 0;

? ? count81 number := 0;

? ? count82 number := 0;

? ? count87 number := 0;

begin

? ? open cemp;

? ? loop

? ? ? ? fetch cemp into phiredate;

? ? ? ? exit when cemp%notfound;

? ? ? ? if phiredate='1980' then count80:=count80+1;

? ? ? ? elsif phiredate='1981' then count81:=count81+1;

? ? ? ? elsif phiredate='1982' then count82:=count82+1;

? ? ? ? else count87 := count87 + 1;

? ? ? ? end if;?

? ? end loop;

? ? close cemp;

? ? dbms_output.put_line('Total '||count80 + count81 + count82 + count87);

? ? dbms_output.put_line('1980 '||count80);

? ? dbms_output.put_line('1981 '||count81);

? ? dbms_output.put_line('1982 '||count82);

? ? dbms_output.put_line('1987 '||count87);

end;

/



錯誤報告 -

ORA-06502: PL/SQL: 數字或值錯誤 :? 字符到數值的轉換錯誤

ORA-06512: 在 line 20

06502. 00000 -? "PL/SQL: numeric or value error%s"

*Cause:? ? An arithmetic, numeric, string, conversion, or constraint error

? ? ? ? ? ?occurred. For example, this error occurs if an attempt is made to

? ? ? ? ? ?assign the value NULL to a variable declared NOT NULL, or if an

? ? ? ? ? ?attempt is made to assign an integer larger than 99 to a variable

? ? ? ? ? ?declared NUMBER(2).

*Action:? ?Change the data, how it is manipulated, or how it is declared so

? ? ? ? ? ?that values do not violate constraints.


正在回答

1 回答

找到原因了:

dbms_output.put_line('Total '||count80 + count81 + count82 + count87);這一句后面要用括號包起來,應該是:

dbms_output.put_line('Total '||(count80 + count81 + count82 + count87));

2 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

請看一下哪里出問題了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號