IT

[스크랩] create or replace procedure ; procedure created with compilation errors

네모세모네모 2009. 2. 12. 10:36

조각조각내서 배우는 것은 몹쓸 짓이지만..... 일단 예제를 중심으로 훑어가는데 의의를 두기로 했다...


SQL> create or replace procedure insert_func
  2  (ssn varchar2, name varchar2, price number) is
  3  begin
  4     insert into goods values(ssn, name, price);                   ///몇번 써봐도 도대체 뭐가문제인지
  5  end insert_func;                                                 //모르겠다... 함수를 작성해놓고
  6  show errors;                                                     //그 작업을 종료하는 법을 몰라서 헤매였는데
  7  q;                                                                //Warning에 나오는 대로 타이핑해서
  8                                                                   //검색했더니 / 가 눈에 띄여서 혹시했더니
  9                                                                   //다행이 종료가 라인이 종료가 되었다..
 10  e
 11  wq;
 12  exit
 13  shutdown;
 14  /

Warning: Procedure created with compilation errors.

SQL> create or replace procedure insert_func
  2  (ssn varchar2, name varchar2, price number) is
  3  begin
  4     insert into goods values(ssn, name, price);
  5  end
  6  /                                                  //이유는 모른다.. 왜 에러랑 같이 만들어졌는지... 썩을.!!!

Warning: Procedure created with compilation errors.

SQL> create or replace procedure insert_func
  2  (ssn varchar2, name varchar2, price number) is
  3  begin
  4     insert into goods values(ssn, name, price);
  5  end
  6  ;
  7  show error;                                         //그래서 몇번더 뻘짓을 했다... ㅜ.ㅜ
  8  /

Warning: Procedure created with compilation errors.

SQL> create or replace procedure insert_func
  2  (ssn varchar2, name varchar2, price number) is
  3  begin
  4     insert into goods values(ssn, name, price);
  5  end;
  6  show errors;                                                     //역시...
  7  /

Warning: Procedure created with compilation errors.

SQL> create or replace procedure insert_func
  2  (ssn in varchar2, name in varchar2, price in number) is             //에러는 못봤지만.. 다른 사람들이
  3  begin                                                                //만든 예를 보니까.. 컬럼명 in 자료형이
  4     insert into goods values(ssn, name, price);                        //눈에 띄여서 함 다르게 써봤다..
  5  end
  6  show errors;
  7  /

Warning: Procedure created with compilation errors.

SQL> show errors                                                      //에러이유를 봐야 하는데 도대체 모르겠어서
Errors for PROCEDURE INSERT_FUNC:                                 //show errors만 쳐봤다.. 정말 혹시나 였다.

LINE/COL ERROR                                                        //감사 땡큐~!!!! 에러이유를 알려준다!!
-------- -----------------------------------------------------------------
6/6      PLS-00103: Encountered the symbol "ERRORS" when expecting one of
         the following:                                                  //바로 전에 맨들었던 구문이 6줄짜리
         ;                                                               //구문이다.. 그래서 바로 다시 맨들었다.

SQL> create or replace procedure insert_func
  2  (ssn in varchar2, name in varchar2, price in number) is
  3  begin
  4     insert into goods values(ssn, name, price);
  5  end
  6  /

Warning: Procedure created with compilation errors.

SQL> show errors
Errors for PROCEDURE INSERT_FUNC:

LINE/COL ERROR
-------- -----------------------------------------------------------------
5/3      PLS-00103: Encountered the symbol "end-of-file" when expecting
         one of the following:
         ; <an identifier> <a double-quoted delimited-identifier>
         delete exists prior <a single-quoted SQL string>
         The symbol ";" was substituted for "end-of-file" to continue.   // ; 이 없다는 소리같다.. 맨 마지막에
                                                                           //그래서 붙이고 다시 맨들었다..
SQL> create or replace procedure insert_func
  2  (ssn in varchar2, name in varchar2, price in number) is
  3  begin
  4     insert into goods values(ssn, name, price);
  5  end;
  6  /

Procedure created.                                  //됐다~!!!!! 휴... 정말 힘들다.. 찾고 치고 -_-;;
                                                     //그래도 하고나면 뭔가 뿌듯하다 ^^
                                                     //그리고 나서 아까 했던, callStatementTest 예제를 실행하니

                                                     //잘된다~!!

출처 : 컴매냐
글쓴이 : 내사랑꿀떡 원글보기
메모 :