안녕하세요 ^^
sql 쿼리 실행하는데 oerr ora 921(unexpected end of sql commend) 발생하는데
아래 쿼리를 툴에서 실행했을때는 이상이 없으나 pro*c 배치에 넣어 실행하면
921 오류가 발생합니다.
왜 그런지 이유가 궁금합니다. ^^;
아마도 힌트 부분에 -- 주석처리 때문인것 같긴한데
where 조건 아래의 조건값들은 -- 주석처리해도
툴이나 pro*c에서 이상이 없습니다.
쿼리 예시)
select /*+ leading(a) index(a ix_aaaa01_01) -- full(a) */
from aaaa01 a
where 1=1
and a.key = '65'
;
sqlplus도 한줄로 실행하면 00921 오류가 나오네요. 하이픈(--)이 원인인 듯 한데.. line break(\n)를 넣는 건 어떨까요
SQL> select /*+ leading(a) index(a ix_aaaa01_01) --full(a) */ * from aaaa01 a where 1=1 and a.key = '65' 2 ; select /*+ leading(a) index(a ix_aaaa01_01) --full(a) */ * from aaaa01 a where 1=1 and a.key = '65' * ERROR at line 1: ORA-00921: unexpected end of SQL command SQL> select /*+ leading(a) index(a ix_aaaa01_01) --full(a) */ ; select /*+ leading(a) index(a ix_aaaa01_01) --full(a) */ * ERROR at line 1: ORA-00921: unexpected end of SQL command SQL> select /*+ leading(a) index(a ix_aaaa01_01) --full(a) 2 */ * from aaaa01 a where 1=1 and a.key = '65' 3 ; KE -- 65