2009-10-21 4 views
1

내가 OracleCommand를을 사용하여 출력 매개 변수를 사용하여 레코드의 수를 읽고이 쿼리를 실행 :이상한 PL/SQL 쿼리와 행동 및 .NET

var query = "declare MyCount number; begin SELECT COUNT(*) INTO :MyCount FROM T_ISSUE; end;"; 

이 하나가 잘 작동합니다.

하지만이 같은 두 줄에 쿼리를 분할하는 경우 :

var query = @"declare MyCount number; 
       begin SELECT COUNT(*) INTO :MyCount FROM T_ISSUE; end;"; 

나는 때라도 예외가 얻을 :

System.Data.OracleClient.OracleException: ORA-06550: line 1, column 25: 
PLS-00103: Encountered the symbol "" when expecting one of the following: 

    begin function package pragma procedure subtype type use 
    <an identifier> <a double-quoted delimited-identifier> form 
    current cursor 
The symbol "" was ignored. 

아무도 이유를 알고?

도움 주셔서 감사합니다.

답변

4

이것은 VS 스타일의 줄 바꿈 (CR + LF)을 사용하지만 Oracle은 유닉스 스타일 만 허용합니다 (LF 만).

적어도 VB6의 경우입니다.