How do I capture a SQLPlus exit code within a shell script?

前端 未结 2 1947
南笙
南笙 2020-12-10 06:26

I have a KornShell (ksh) script that logins into SQL*Plus and executing a script. Within the shell script I would like to capture the status code of the SQL statement that

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 06:38

    Exit from the sql file with

    exit sql.sqlcode;
    

    capture it in shell with $?

提交回复
热议问题