更新时间:2023-12-05 11:28:58
对于这些类型的错误,SQL * Plus正在挂起"用户名提示符,因为它无法连接.由于-s
标志,您看不到它.默认情况下,它将允许进行三次尝试,这在交互式运行时很有用,而在从此类脚本运行时则无济于事.您可以使用
For those kinds of errors, SQL*Plus is 'hanging' at a username prompt, as it hasn't been able to connect. You don't see that because of the -s
flag. By default it will allow three attempts, which is useful when running interactively, but isn't helpful when run from a script like this. You can make it exit after the failed login with the -l
'logon' option:
sqlplus -s -l %%A @fetch.sql >> output.txt