Creating procedures using SQLScript

Procedures are a set of statements that are reusable. We use SQLScript to create stored procedures. It is required that you know the basics of the SQLScript language before creating procedures.

Getting ready

To create SQLScript procedures, we should have a basic knowledge of SAP HANA SQLScript.

How to do it…

Open SQL Console for the specific schema where the procedure has to be created or create the procedure from Quick Launch. A sample procedure is shown in the following code snippet:

CREATE PROCEDURE SAP_HANA_COOKBOOK LANGUAGE SQLSCRIPT AS BEGIN
INSERT INTO CUSTOMER_INFO values (1,'CUSTOMER1', 1,'INDIA');
INSERT INTO CUSTOMER_INFO values (2,'CUSTOMER2', 1,'INDIA');
END;

How it works…

In the preceding section, we ...

Get SAP HANA Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.