정의 예외
4186 단어 이상
SQL> set serveroutput on;
SQL> declare
2 num int;
3 begin
4 num := 'ssddfasf';
5 exception
6 when value_error
7 then dbms_output.put_line('---- ------');
8 end;
9 /
---- ------
PL/SQL procedure successfully completed.
SQL> declare
2 sumsal emp.sal%type;
3 begin
4 select sum(sal) into sumsal from scott.emp group by deptno having deptno=30;
5 if sumsal>5000 then
6 dbms_output.put_line(' 30 , :'||sumsal);
7 end if;
8 end;
9 /
sumsal emp.sal%type;
*
ERROR at line 2:
ORA-06550: line 2, column 8:
PLS-00201: identifier 'EMP.SAL' must be declared
ORA-06550: line 2, column 8:
PL/SQL: Item ignored
ORA-06550: line 4, column 22:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 4, column 29:
PL/SQL: ORA-00904: : invalid identifier
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored
ORA-06550: line 5, column 4:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 5, column 1:
PL/SQL: Statement ignored
SQL> conn scott.emp
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_identifier>] | /
SQL> conn scott/tiger
Connected.
SQL> declare
2 sumsal emp.sal%type;
3 begin
4 select sum(sal) into sumsal from emp group by deptno having deptno=30;
5 if sumsal>5000 then
6 dbms_output.put_line(' 30 , :'||sumsal);
7 end if;
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> conn system/manager
Connected.
SQL> declare
2 sumsal scott.emp.sal%type;
3 begin
4 select sum(sal) into sumsal from scott.emp group by deptno having deptno=30;
5 if sumsal>5000 then
6 dbms_output.put_line(' 30 , :'||sumsal);
7 end if;
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> set serveroutput on;
SQL> declare
2 sumsal scott.emp.sal%type;
3 begin
4 select sum(sal) into sumsal from scott.emp group by deptno having deptno=30;
5 if sumsal>5000 then
6 dbms_output.put_line(' 30 , :'||sumsal);
7 end if;
8 end;
9 /
30 , :9400
PL/SQL procedure successfully completed.
SQL> declare
2 dempno int :=7902;
3 /
dempno int :=7902;
*
ERROR at line 2:
ORA-06550: line 2, column 18:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor
SQL> declare
2 enames emp.ename%type;
3 jobs emp.job%type;
4 hiredates emp.hiredate%type;
5 begin
6 select ename into enames from emp where empno=7902;
7 select job into jobs from emp where empno=7902;
8 select hiredate into hiredates from emp where empno=7902;
9 dbms_output.put_line(enames);
10 dbms_output.put_line(jobs);
11 dbms_output.put_line(hiredates);
12 end;
13 /
FORD
ANALYST
03-12 -81
PL/SQL procedure successfully completed.
SQL> spool off;
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Springboot 사용자 정의 예외 처리 상세 정보배경 Springboot은 기본적으로 이상한 처리를 모델 AndView에 집중시켰지만, 프로젝트의 실제 과정에서 이렇게 하면 우리의 요구를 만족시킬 수 없습니다.구체적인 사용자 정의 이상 처리는 다음과 같다. 구체적...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.