SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Anonymous Blocks

Leveraging SQLScript in stored procedures, user-defined functions, and user-defined libraries.

Overview

🎓 intermediate 15 min. SAP HANAIntermediateSqlExpress EditionSAP HANA Cloud

You will learn

  • โœ”How to invoke SQLScript logic without a persistent logic container
Rich Heilman R Rich Heilman November 1, 2022
Created by September 5, 2016
Contributors

Prerequisites

Prerequisites

Steps

Intro

In this exercise, we will show you how you can invoke SQLScript logic without the need to create a persistent logic container such as a procedure or function. Instead we will use so called anonymous blocks.


Step 1 Create anonymous block
โ€”

From the Database Explorer page, click the “SQL Console” button

SQL console
SQL console

To have an anonymous block you need a do begin โ€ฆ end. Enter the this code in the SQL tab.

SQL tab
SQL tab

Step 2 Add body of statement
+
Step 3 Declare required variable
+
Step 4 Check complete code
+
Step 5 Run and check results
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Create anonymous block 2. Add body of statement 3. Declare required variable 4. Check complete code 5. Run and check results

Learn more →