Skip to Content

Execute Alter System in HANA Procedure

Hi,

I am trying run alter system in Hana Procedure, but the Hana return error.

create procedure clear_audit_log language sqlscript as Begin declare v_date timestamp; SELECT ADD_DAYS (TO_DATE ('2019-02-19', 'YYYY-MM-DD'), -1) FROM DUMMY; ALTER SYSTEM CLEAR AUDIT LOG UNTIL 'v_date'; end;

SAP DBTech JDBC: [7]: feature not supported: System management statement is/are not supported in procedure: line 5 col 2 (at pos 165)

How to execute alter system in Hana Procedure? Is it possible?

Thanks',

Jurandyr Alves

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Feb 20, 2019 at 03:02 PM

    Hi Guys,

    I could solved this issue.

    create procedure clear_log_audit language sqlscript as Begin declare v_date timestamp; v_date := ADD_DAYS (TO_DATE (current_date, 'YYYY-MM-DD'), -15); execute immediate 'ALTER SYSTEM CLEAR AUDIT LOG UNTIL ''' || v_date || ''' '; end;

    That procedure clear audit log with more 15 days.

    Now is make a job for run one time every day.

    Stay suggestion!!!!!!!!!!!!!!!!!

    Thanks',

    Jurandyr Alves

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.