SAP

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

You will learn

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

More from Rich Heilman

See all 20 tutorials by Rich Heilman →

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
Next