Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Real Time Analytics with SAP Hana

You're reading from   Real Time Analytics with SAP Hana Enhance your SAP HANA skills using this step-by-step guide to creating and reporting data models for real-time analytics

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781782174110
Length 226 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Vinay Singh Vinay Singh
Author Profile Icon Vinay Singh
Vinay Singh
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Kickoff – Before We Start 2. SAP HANA Data Modeling Approach FREE CHAPTER 3. Different Ways of SAP HANA Data Load 4. Creating SAP HANA Artifacts Attribute Views and Analytical Views 5. Creating SAP HANA Artifacts – Analytical Privileges and Calculation Views 6. Understanding Text Search and Hierarchies in SAP HANA 7. Using Decision Tables and Transporting SAP HANA Content 8. Consuming SAP HANA Data Models 9. An Introduction to Application Function Library Index

The SAP HANA SQLscript

In the following section, we will learn about the SAP HANA SQLscript and see the additional capabilities it brings along with it.

Why SQLscript?

SQLscript is a collection of extensions in Structured Query Language (SQL). The main motivation for SQLscript is to push data intensive application logic into the database, which was not being done in the classical approach where the application logic is mostly executed in an application layer.

We have the following extensions for SQLscript:

Extension

Usage

Datatype extension (create/drop type)

This allows definition of table type without corresponding tables

Procedural extension (create procedure)

This is an imperative construct to push data intensive logic into the database

Functional extension (create function)

This creates side-effect free scalar or table functions, which can be used to express and encapsulate complex data flows

How different is an SQLscript in SAP HANA from classical SQL queries?

Let's do a comparative study between an SQLscript in SAP HANA and classical SQL queries to find out what the point of differences are, as shown in the following table:

SQLscript in SAP HANA

Classical SQL

Multiple result sets can be returned

Query returns only single result set

More database intensive, codes are executed at DB layer, gives better performance

Limited executions at DB layer resulting in multiple access to and from database, relatively slow performance

Control logics such as if/else and business logics like currency conversion can be easily expressed

SQL queries do not have such features

Gives more flexibility to developer to use imperative and declarative logics together

No such flexibility with SQL queries

Supports local variables for intermediate result sets with implicit types

Globally visible views need to be defined even for intermediate result sets or steps

Parameterization of views is possible

Parameterization of views is not possible

The following figure shows you a graphical comparison of the classical approach and the SAP HANA approach:

How different is an SQLscript in SAP HANA from classical SQL queries?
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime