Search code examples
oracle-databasesqlplussqlcl

sqlcl errorlog configuration


I like to setup my oracle database scripts to fail in the event of any database or OS problem.

I've been considering migrating to SQLCL, but the SQL*Plus approach I'd taken for detecting and triggering rollback for non-database problems is failing with SQLCL and I wondered if anyone has an alternative solution (or a good workaround).

I've been using SET ERRORLOGGING to direct any SP- errors to SPERRORLOG, where I can detect them before committing and decide rollback/branch/continue/alert, etc.

I grabbed the latest sqlcl (June 2016 sqlcl-4.2.0.16.175.1027), hoping for a fix to the following problem, but it persists.

When issuing SET ERRORLOGGING ON, I get the following:

SQL> SET ERRORLOGGING ON 
SP2-0158: unknown SET option beginning "errorloggi..."

The manual entry seems to indicate nothing else for this option has changed in SQLCL.

SQL> help set errorlogging 
SET ERRORLOGGING 
ERRORL[OGGING]{ON|OFF} 
[TABLE [schema.]tablename]     [TRUNCATE] [IDENTIFIER  identifier]

Is this just a bug, or is there something else needed to get ERRORLOGGING up and running?

If this is a bug, is there a good alternative to detect SP(2)- errors?


Solution

  • Well, it seems, despite the fact that the errorlogging setting is present among available SQLcl's set settings, it's unsupported at the moment.

    Run show <setting> command to check if a setting's supported or not.

    ./sql -v
    
    SQLcl: Release 4.2.0.16.175.1027 RC
    
    SQL> help set errorlogging
    
    SET ERRORLOGGING
       ERRORL[OGGING] {ON|OFF}
       [TABLE [schema.]tablename] 
       [TRUNCATE] [IDENTIFIER identifier]
    
    SQL> show errorlogging
    errorlogging Unsupported