Automic Workload Automation

 View Only
  • 1.  Calling EXEC from SQL JOB ends with ora-00900: invalid sql statement

    Posted Jun 20, 2017 05:46 AM
    Hi everybody,
    this is my first post and I am quite new to the tool so I apologize in advance if this is trivial but I could not find any solution to the following.

    I have SQL JOB connecting to an Oracle DB. The job process tab is configured to call a custom function, something like:
    exec mypackage.func(1)
    The job execution is aborted with the following error:
    ORA-00900: invalid SQL statement
    If I replace the EXEC with a SELECT statement it works fine, I guess the JOB configuration is fine.
    If I copy paste the EXEC statement to a sqlplus window (same user) it works.

    Any clue on what is going on?

    Thanks in advance.

    Best regards,
    Marco


  • 2.  Calling EXEC from SQL JOB ends with ora-00900: invalid sql statement

    Posted Jun 20, 2017 05:58 AM
    I think I finally found a solution:
    SQL_SET_STATEMENT_TERMINATOR TERM='@';
    BEGIN mypackage.func(1); END; @



  • 3.  RE: Calling EXEC from SQL JOB ends with ora-00900: invalid sql statement

    Posted Feb 25, 2021 08:59 PM

    Thank you Marco,

    I had the same problem and now my jobs are working with your solution.

    Regards!