Sql*plus always returns exit code 0?

后端 未结 3 1366
梦毁少年i
梦毁少年i 2020-11-29 11:06

Whenever I run a sql script using Sql*plus and check for $?, I get 0 even when the script wasn\'t succesful.

Example

#$ sqlplus user/password@instanc         


        
3条回答
  •  感情败类
    2020-11-29 11:31

    Vlad's is the answer I'd use. To augment his, however, I try to use an explicit EXIT statement if I really need that return status. For example

    column status_for_exit new_value exitcode noprint
    select status_computation (parm, parm) as status_for_exit from dual;
    
    exit &exitcode;
    

提交回复
热议问题