Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Scheduling stored procedures via XS jobs

Hi,

I have a stored procedure that accepts a parameter. Like ProcedureExample('<SchemaName>').

Now I need it become schedulable via an XS job through the XS dashboard.

Unfortunately, I don't have a clue on how to start on this.

I found some links but no examples of how to do this but none of them explain how I can make the job pass parameters.

It would be a great help if someone could post an example.

Thanks,

SHyam

Tags:
Former Member replied

Hi Shyam,


1. You need to have sap.hana.xs.admin.roles::JobAdministrator privilege.


2. Create the stored procedure your talking about to run at regular intervals.


3. Create a job file .xsjob that defines details of the recurring task.


In your case it would look something like this run_procedure.xsjob

Eg:


{

    "description": "Runs the procedure",

    "action": "package_path::procedure_name",

    "schedules": [

       {

          "description": "Runs the procedure every 59th second every year every day",

          "xscron": "* * * * * * 59",

          "parameter": {

             "schema_name": "XYZ"

             }

       }

    ]

}

4. Maintian the XS job's runtime configuration :

     a. Login to XS dashboard using           http://<WebServerHost>:80<SAPHANAinstance>/sap/hana/xs/admin/

     b. Create the job by configuring it, you need to know the user_name, password, locale, start           and stop time, Active.

     c. Save the job

5. Enable the job scheduling feature in SAP HANA by doule click on system -> xsengine.ini -> scheduler -> enabled. (Need to have admin rights to do this).

6. Check the job logs, your scheduled job must be running every 59th second.

Regards,

Anil

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question