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 saw a code snippet that will create a procedure. The syntax to create a procedure is shown in the following code:
CREATE PROCEDURE <schema>.<procedure_name> {({IN|OUT|INOUT} param_name data_type {,...})} {LANGUAGE <LANG>} {SQL SECURITY...