오류가 발생하면 사용자 정의 메시지를 인쇄하여 SQLPlus에서 오류를 처리하는 방법은 무엇입니까? 나는 아래에 나의 코드를 넣었다.Bash 스크립트에서 Oracle 오류 처리
내 코드
#!/bin/bash
echo "My Scripts run below"
sqlplus -S UID1/[email protected]<< EOF
whenever sqlerror exit sql.sqlcode;
@/path/Script1
@/path/Script2
exit;
EOF
echo "My Scripts have run"
출력
My Scripts run below
SP2-0310: unable to open file "/path/Script1.sql"
SP2-0310: unable to open file "/path/Script2.sql"
My Scripts have run
필수 출력 실제로
My Scripts run below
**Below error in Script1**
SP2-0310: unable to open file "/path/Script1.sql"
**Below error in Script2**
SP2-0310: unable to open file "/path/Script2.sql"
My Scripts have run