SlideShare a Scribd company logo
1© 2014 SAP AG or an SAP affiliate company. All rights reserved.
SAP HANA SPS 11 - What’s New?
HANA SQL
SAP HANA Product Management December, 2015
(Delta from SPS 10 to SPS 11)
© 2015 SAP SE or an SAP affiliate company. All rights reserved. 2Public
Disclaimer
This presentation outlines our general product direction and should not be relied on in making
a purchase decision. This presentation is not subject to your license agreement or any other
agreement with SAP.
SAP has no obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This presentation and
SAP’s strategy and possible future developments are subject to change and may be changed
by SAP at any time for any reason without notice.
This document is provided without a warranty of any kind, either express or implied, including
but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or
non-infringement. SAP assumes no responsibility for errors or omissions in this document,
except if such damages were caused by SAP intentionally or grossly negligent.
© 2015 SAP SE or an SAP affiliate company. All rights reserved. 3Public
Agenda
CASE JOIN
New SQL Functions
Supportability
Projection Views
CASE JOIN
© 2015 SAP SE or an SAP affiliate company. All rights reserved. 5Public
New JOIN Type for “Extension by Custom Fields” and Views
ext1
br2
BSEG
VBSEGD
br1
ext2
Union All View
BSEG br1 br2VBSEGD
ext1BSEG br1
br2VBSEGD
Final View
New: Case Join Select * from V left outer many to one case join
when br = 'br1' then
return ext1 as ext from BSEG on V.key = BSEG.key
when br = 'br2' then
return ext2 as ext from VBSEGD on V.key = VBSEGD.key
end;
pruning out unnecessary self-joins,
re-define only the top-most view
ext2
SQL Functions
© 2015 SAP SE or an SAP affiliate company. All rights reserved. 7Public
SQL Functions
group_contains(), group_why_found(), group_score()
• Query searches for objects that match a pattern over multi-records and multi-columns
to_snumc(), snumc_to_int(), snumc_to_bigint(), snumc_to_decimal()
• current to_alphanum() function converts integer-values in a character-format, which is specifically used to
integrate “external” integer data directly into the BW-Reporting as characteristics
• non-SQL standard behavior (cannot be pushed down to other DBMS for SDA, no support for DT)
• No support for negative numbers
• New functions preserves order in target string and can handle negative numbers
Supportability
© 2015 SAP SE or an SAP affiliate company. All rights reserved. 9Public
Monitoring Views
M_EXECUTED_STATEMENTS (New)
 Historize executed DDL operations
 Similar fields like m_expensive_statements, but includes error_code and error_text
 Enabled by default
M_EXPENSIVE_STATEMENTS (ENHANCED); downported to rev102
 Column “workload_class_name” added
 Displays mapped workload class of a statement (if workload class is defined)
M_CONNECTIONS (ENHANCED); downported to rev102
 Column “close_reason” added, e.g. 'due to idle connection timeout’
 empty for normal cases
Projection View
© 2015 SAP SE or an SAP affiliate company. All rights reserved. 11Public
Projection View
New Viewtype
 New:
– Can be used in HANA column views
– Insert/Update/Delete triggers on projection view are supported
 Syntax:
– CREATE PROJECTION VIEW < view_name> [(<column_name_list>)] AS SELECT <field_list> FROM [<schema>.]<table_name>
– DROP VIEW <view_name>
 Pre-requisite
– Projection view must include all primary keys of the underlying table
12© 2014 SAP AG or an SAP affiliate company. All rights reserved.
SAP HANA SPS 11 - What’s New?
SQLScript
SAP HANA Product Management November, 2015
(Delta from SPS 10 to SPS 11)
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 13
SQLScript – What’s New in SPS 11?
Tooling
 No new developments for SPS 11
Language
 ALTER PROCEDURE/ALTER FUNCTION Support
 TRUNCATE Support
 Filter pushdown for Table User Defined Functions
 System Variables for Current Objects
 Default Values for Table Variables and Parameters
 DEFAULT EMPTY for Table IN/OUT Parameters
 IS_EMPTY() Function for Table and Table Variables
 Index-based Cell Access for Table Variables and Parameters
 HANA Spatial Support
 SQL Injection Prevention Build-in Procedures
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 14
SQLScript – What’s New in SPS 11
Filter Pushdown for Table User Defined Functions
• Filter by column of table UDF via
WHERE clause
• Filter is pushed down, and result
set is not materialized before the
filtering
• Prior to SPS11, filter pushdown
was blocked for table UDF which
contained imperative logic
constructs.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 15
SQLScript – What’s New in SPS 11
System Variables for Object Name and Schema
• Use
::CURRENT_OJECT_SCHEMA
to return the schema name of
the current procedure or
function
• Use
::CURRENT_OBJECT_NAME
to return the name of the
current procedure or function
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 16
SQLScript – What’s New in SPS 11
Default Values for Table Variables & Parameters
• Used to initialize table
variables and parameters
with tabular data
• Reference a persisted table
which contains the data
• DEFAULT can also be used
within the DECLARE
statement
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 17
SQLScript – What’s New in SPS 11
Default Empty IN/OUT Table Parameters
• Used to initialize IN/OUT
table parameters
• If DEFAULT EMPTY is not
used and no assignment to
the output parameter exists
in the body, an error occurs.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 18
SQLScript – What’s New in SPS 11
IS_EMPTY
• Used to determine if a table
variable/parameter or table contains
any rows
SPS10 SPS11
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 19
SQLScript – What’s New in SPS 11
Index-based Cell Access for Table Variables
• Used to directly access any cell
(read/write) within a table
variable or parameter
• <table>.<column>[<index>]
notation
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 20
SQLScript – What’s New in SPS 11
Spatial Support
• SQLScript supports the
spatial data type
ST_GEOMETRY and SQL
spatial functions to access
and manipulate the spatial
data.
• SQLScript also supports the
objective style function
calls, which is needed for
some SQL spatial functions.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. 21
SQLScript – What’s New in SPS 11
Injection Prevention Built-In Procedure
• There is a danger of SQL injection attack if dynamic SQL statements are used, where the parts
of it are derived from untrusted input (e.g. user interface).
• ESCAPE_SINGLE_QUOTES(string_var)
 used for variables containing a SQL string literal
• ESCAPE_DOUBLE_QUOTES(string_var)
 used for variables containing a delimited SQL identifier
• IS_SQL_INJECTION_SAFE(string_var[, num_tokens])
 used to check that a variable contains safe simple SQL identifiers (up to num_tokens, default is 1)
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Thank you
Contact information
Ruediger Karl & Rich Heilman
SAP HANA Product Management
AskSAPHANA@sap.com

More Related Content

PPTX
Whats New on SAP HANA SPS 11 Core Database Capabilities
PPTX
What's New in SAP HANA View Modeling
PDF
SAP HANA SPS10- Predictive Analysis Library and Application Function Modeler
PPTX
SAP HANA SPS1- SAP HANA Hardware Platforms
PDF
SAP HANA SPS10- Series Data/ TimeSeries
PPTX
What's New in SAP HANA SPS 11 DB Control Center (Operations)
PPTX
What's new for Spatial in SAP HANA SPS 11
PDF
SAP HANA SPS10- SAP HANA Development Tools
Whats New on SAP HANA SPS 11 Core Database Capabilities
What's New in SAP HANA View Modeling
SAP HANA SPS10- Predictive Analysis Library and Application Function Modeler
SAP HANA SPS1- SAP HANA Hardware Platforms
SAP HANA SPS10- Series Data/ TimeSeries
What's New in SAP HANA SPS 11 DB Control Center (Operations)
What's new for Spatial in SAP HANA SPS 11
SAP HANA SPS10- SAP HANA Development Tools

What's hot (20)

PDF
What's New in SAP HANA SPS 11 Operations
PDF
SAP HANA SPS10- SAP HANA Dynamic Tiering
PPTX
What's new for Text in SAP HANA SPS 11
PDF
SAP HANA SPS09 - SAP HANA Core & SQL
PPTX
SAP HANA Native Application Development
PPTX
What's new for SAP HANA SPS 11 Dynamic Tiering
PPTX
What's new in SAP HANA SPS 11 Security
PDF
SAP HANA SPS10- Multitenant Database Containers
PPTX
What's New in SAP HANA SPS 11 Predictive
PPTX
What's new on SAP HANA Workload Management
PDF
SAP HANA SPS10- SAP HANA Remote Data Sync
PPTX
What's New in SAP HANA SPS 11 Application Lifecycle Management
PDF
SAP HANA SPS09 - Security
PDF
SAP HANA SPS10- Workload Management
PPTX
What's New in SAP HANA SPS 11 Backup and Recovery (Operations)
PDF
SAP HANA SPS10- Backup/Recovery
PPTX
What's New in SPS11 Overview
PPTX
HANA SPS07 SQL Script
PDF
SAP HANA SPS09- Administration Monitoring
PPTX
What's New in SAP HANA SPS 11 Platform Lifecycle Management (Operations)
What's New in SAP HANA SPS 11 Operations
SAP HANA SPS10- SAP HANA Dynamic Tiering
What's new for Text in SAP HANA SPS 11
SAP HANA SPS09 - SAP HANA Core & SQL
SAP HANA Native Application Development
What's new for SAP HANA SPS 11 Dynamic Tiering
What's new in SAP HANA SPS 11 Security
SAP HANA SPS10- Multitenant Database Containers
What's New in SAP HANA SPS 11 Predictive
What's new on SAP HANA Workload Management
SAP HANA SPS10- SAP HANA Remote Data Sync
What's New in SAP HANA SPS 11 Application Lifecycle Management
SAP HANA SPS09 - Security
SAP HANA SPS10- Workload Management
What's New in SAP HANA SPS 11 Backup and Recovery (Operations)
SAP HANA SPS10- Backup/Recovery
What's New in SPS11 Overview
HANA SPS07 SQL Script
SAP HANA SPS09- Administration Monitoring
What's New in SAP HANA SPS 11 Platform Lifecycle Management (Operations)
Ad

Viewers also liked (13)

PDF
SAP HANA SPS10- SAP HANA Modeling
PDF
SAP HANA SPS12 Exploring New Features
PDF
SAP HANA SPS12 Upgrade and Exploring New Features - Part 1
PDF
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...
PPTX
What's new on SAP HANA Smart Data Access
PDF
Five Reasons To Skip SAP Suite on HANA and Go Directly to SAP S/4HANA
PDF
SAP HANA SPS10- SQLScript
PDF
Managing and Monitoring HANA 2 active:active with System Replication
PDF
Webinar SAP BusinessObjects Cloud (English)
PPTX
What's New for SAP HANA Smart Data Integration & Smart Data Quality
PDF
Sap hana tutorial
PDF
SAP HANA SPS09 - Text Analysis
PPTX
Text Analysis with SAP HANA
SAP HANA SPS10- SAP HANA Modeling
SAP HANA SPS12 Exploring New Features
SAP HANA SPS12 Upgrade and Exploring New Features - Part 1
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...
What's new on SAP HANA Smart Data Access
Five Reasons To Skip SAP Suite on HANA and Go Directly to SAP S/4HANA
SAP HANA SPS10- SQLScript
Managing and Monitoring HANA 2 active:active with System Replication
Webinar SAP BusinessObjects Cloud (English)
What's New for SAP HANA Smart Data Integration & Smart Data Quality
Sap hana tutorial
SAP HANA SPS09 - Text Analysis
Text Analysis with SAP HANA
Ad

Similar to What's new in SAP HANA SPS 11 SQL/SQLScript (20)

PPTX
New features of SQL 2012
PDF
SAP HANA SPS10- Extended Application Services (XS) Programming Model
DOCX
Top MNC'S Interview questions and answers
PPT
Advance Features In Procedues And Triggers
PPTX
Exciting Features for SQL Devs in SQL 2012
PDF
SAP ( ABAP CDS ) Core Data Services.pdf
PPTX
New Features of SQL Server 2016
PDF
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
PDF
2011 Collaborate IOUG Presentation
PDF
Structured Query Language (SQL) - An Introduction
PPT
Advanced Sql Training
PDF
Database Systems Design Implementation and Management 11th Edition Coronel So...
PDF
SAP HANA SPS09 - HANA Modeling
PDF
Database Systems Design Implementation and Management 11th Edition Coronel So...
PDF
Database Systems Design Implementation and Management 11th Edition Coronel So...
PPT
Preparing for BIT – IT2301 Database Management Systems 2001f
PDF
Database Systems Design Implementation and Management 11th Edition Coronel So...
PDF
DP080_Lecture_2 SQL related document.pdf
PDF
ABAP Coding Standards Reference Guide
PDF
Database Systems Design Implementation and Management 11th Edition Coronel So...
New features of SQL 2012
SAP HANA SPS10- Extended Application Services (XS) Programming Model
Top MNC'S Interview questions and answers
Advance Features In Procedues And Triggers
Exciting Features for SQL Devs in SQL 2012
SAP ( ABAP CDS ) Core Data Services.pdf
New Features of SQL Server 2016
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
2011 Collaborate IOUG Presentation
Structured Query Language (SQL) - An Introduction
Advanced Sql Training
Database Systems Design Implementation and Management 11th Edition Coronel So...
SAP HANA SPS09 - HANA Modeling
Database Systems Design Implementation and Management 11th Edition Coronel So...
Database Systems Design Implementation and Management 11th Edition Coronel So...
Preparing for BIT – IT2301 Database Management Systems 2001f
Database Systems Design Implementation and Management 11th Edition Coronel So...
DP080_Lecture_2 SQL related document.pdf
ABAP Coding Standards Reference Guide
Database Systems Design Implementation and Management 11th Edition Coronel So...

More from SAP Technology (20)

PPTX
SAP Integration Suite L1
PDF
Future-Proof Your Business Processes by Automating SAP S/4HANA processes with...
PDF
7 Top Reasons to Automate Processes with SAP Intelligent Robotic Processes Au...
PDF
Extend SAP S/4HANA to deliver real-time intelligent processes
PDF
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...
PDF
Accelerate your journey to SAP S/4HANA with SAP’s Business Technology Platform
PDF
Accelerate Your Move to an Intelligent Enterprise with SAP Cloud Platform and...
PDF
Transform your business with intelligent insights and SAP S/4HANA
PDF
SAP Cloud Platform for SAP S/4HANA: Accelerate your move to an Intelligent En...
PPTX
Innovate collaborative applications with SAP Jam Collaboration & SAP Cloud Pl...
PDF
The IoT Imperative for Consumer Products
PDF
The IoT Imperative for Discrete Manufacturers - Automotive, Aerospace & Defen...
PDF
IoT is Enabling a New Era of Shareholder Value in Energy and Natural Resource...
PDF
The IoT Imperative in Government and Healthcare
PDF
SAP S/4HANA Finance and the Digital Core
PPTX
SAP Helps Reduce Silos Between Business and Spatial Data
PDF
Why SAP HANA?
PPTX
Spotlight on Financial Services with Calypso and SAP ASE
PPTX
SAP ASE 16 SP02 Performance Features
PDF
Spark Usage in Enterprise Business Operations
SAP Integration Suite L1
Future-Proof Your Business Processes by Automating SAP S/4HANA processes with...
7 Top Reasons to Automate Processes with SAP Intelligent Robotic Processes Au...
Extend SAP S/4HANA to deliver real-time intelligent processes
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...
Accelerate your journey to SAP S/4HANA with SAP’s Business Technology Platform
Accelerate Your Move to an Intelligent Enterprise with SAP Cloud Platform and...
Transform your business with intelligent insights and SAP S/4HANA
SAP Cloud Platform for SAP S/4HANA: Accelerate your move to an Intelligent En...
Innovate collaborative applications with SAP Jam Collaboration & SAP Cloud Pl...
The IoT Imperative for Consumer Products
The IoT Imperative for Discrete Manufacturers - Automotive, Aerospace & Defen...
IoT is Enabling a New Era of Shareholder Value in Energy and Natural Resource...
The IoT Imperative in Government and Healthcare
SAP S/4HANA Finance and the Digital Core
SAP Helps Reduce Silos Between Business and Spatial Data
Why SAP HANA?
Spotlight on Financial Services with Calypso and SAP ASE
SAP ASE 16 SP02 Performance Features
Spark Usage in Enterprise Business Operations

Recently uploaded (20)

PPTX
climate analysis of Dhaka ,Banglades.pptx
PDF
annual-report-2024-2025 original latest.
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
PDF
Fluorescence-microscope_Botany_detailed content
PDF
Lecture1 pattern recognition............
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPT
Quality review (1)_presentation of this 21
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPTX
Introduction to machine learning and Linear Models
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PDF
Business Analytics and business intelligence.pdf
climate analysis of Dhaka ,Banglades.pptx
annual-report-2024-2025 original latest.
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
Fluorescence-microscope_Botany_detailed content
Lecture1 pattern recognition............
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Quality review (1)_presentation of this 21
IBA_Chapter_11_Slides_Final_Accessible.pptx
Supervised vs unsupervised machine learning algorithms
Miokarditis (Inflamasi pada Otot Jantung)
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
STUDY DESIGN details- Lt Col Maksud (21).pptx
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
Introduction to machine learning and Linear Models
Data_Analytics_and_PowerBI_Presentation.pptx
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Business Analytics and business intelligence.pdf

What's new in SAP HANA SPS 11 SQL/SQLScript

  • 1. 1© 2014 SAP AG or an SAP affiliate company. All rights reserved. SAP HANA SPS 11 - What’s New? HANA SQL SAP HANA Product Management December, 2015 (Delta from SPS 10 to SPS 11)
  • 2. © 2015 SAP SE or an SAP affiliate company. All rights reserved. 2Public Disclaimer This presentation outlines our general product direction and should not be relied on in making a purchase decision. This presentation is not subject to your license agreement or any other agreement with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to develop or release any functionality mentioned in this presentation. This presentation and SAP’s strategy and possible future developments are subject to change and may be changed by SAP at any time for any reason without notice. This document is provided without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this document, except if such damages were caused by SAP intentionally or grossly negligent.
  • 3. © 2015 SAP SE or an SAP affiliate company. All rights reserved. 3Public Agenda CASE JOIN New SQL Functions Supportability Projection Views
  • 5. © 2015 SAP SE or an SAP affiliate company. All rights reserved. 5Public New JOIN Type for “Extension by Custom Fields” and Views ext1 br2 BSEG VBSEGD br1 ext2 Union All View BSEG br1 br2VBSEGD ext1BSEG br1 br2VBSEGD Final View New: Case Join Select * from V left outer many to one case join when br = 'br1' then return ext1 as ext from BSEG on V.key = BSEG.key when br = 'br2' then return ext2 as ext from VBSEGD on V.key = VBSEGD.key end; pruning out unnecessary self-joins, re-define only the top-most view ext2
  • 7. © 2015 SAP SE or an SAP affiliate company. All rights reserved. 7Public SQL Functions group_contains(), group_why_found(), group_score() • Query searches for objects that match a pattern over multi-records and multi-columns to_snumc(), snumc_to_int(), snumc_to_bigint(), snumc_to_decimal() • current to_alphanum() function converts integer-values in a character-format, which is specifically used to integrate “external” integer data directly into the BW-Reporting as characteristics • non-SQL standard behavior (cannot be pushed down to other DBMS for SDA, no support for DT) • No support for negative numbers • New functions preserves order in target string and can handle negative numbers
  • 9. © 2015 SAP SE or an SAP affiliate company. All rights reserved. 9Public Monitoring Views M_EXECUTED_STATEMENTS (New)  Historize executed DDL operations  Similar fields like m_expensive_statements, but includes error_code and error_text  Enabled by default M_EXPENSIVE_STATEMENTS (ENHANCED); downported to rev102  Column “workload_class_name” added  Displays mapped workload class of a statement (if workload class is defined) M_CONNECTIONS (ENHANCED); downported to rev102  Column “close_reason” added, e.g. 'due to idle connection timeout’  empty for normal cases
  • 11. © 2015 SAP SE or an SAP affiliate company. All rights reserved. 11Public Projection View New Viewtype  New: – Can be used in HANA column views – Insert/Update/Delete triggers on projection view are supported  Syntax: – CREATE PROJECTION VIEW < view_name> [(<column_name_list>)] AS SELECT <field_list> FROM [<schema>.]<table_name> – DROP VIEW <view_name>  Pre-requisite – Projection view must include all primary keys of the underlying table
  • 12. 12© 2014 SAP AG or an SAP affiliate company. All rights reserved. SAP HANA SPS 11 - What’s New? SQLScript SAP HANA Product Management November, 2015 (Delta from SPS 10 to SPS 11)
  • 13. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 13 SQLScript – What’s New in SPS 11? Tooling  No new developments for SPS 11 Language  ALTER PROCEDURE/ALTER FUNCTION Support  TRUNCATE Support  Filter pushdown for Table User Defined Functions  System Variables for Current Objects  Default Values for Table Variables and Parameters  DEFAULT EMPTY for Table IN/OUT Parameters  IS_EMPTY() Function for Table and Table Variables  Index-based Cell Access for Table Variables and Parameters  HANA Spatial Support  SQL Injection Prevention Build-in Procedures
  • 14. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 14 SQLScript – What’s New in SPS 11 Filter Pushdown for Table User Defined Functions • Filter by column of table UDF via WHERE clause • Filter is pushed down, and result set is not materialized before the filtering • Prior to SPS11, filter pushdown was blocked for table UDF which contained imperative logic constructs.
  • 15. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 15 SQLScript – What’s New in SPS 11 System Variables for Object Name and Schema • Use ::CURRENT_OJECT_SCHEMA to return the schema name of the current procedure or function • Use ::CURRENT_OBJECT_NAME to return the name of the current procedure or function
  • 16. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 16 SQLScript – What’s New in SPS 11 Default Values for Table Variables & Parameters • Used to initialize table variables and parameters with tabular data • Reference a persisted table which contains the data • DEFAULT can also be used within the DECLARE statement
  • 17. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 17 SQLScript – What’s New in SPS 11 Default Empty IN/OUT Table Parameters • Used to initialize IN/OUT table parameters • If DEFAULT EMPTY is not used and no assignment to the output parameter exists in the body, an error occurs.
  • 18. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 18 SQLScript – What’s New in SPS 11 IS_EMPTY • Used to determine if a table variable/parameter or table contains any rows SPS10 SPS11
  • 19. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 19 SQLScript – What’s New in SPS 11 Index-based Cell Access for Table Variables • Used to directly access any cell (read/write) within a table variable or parameter • <table>.<column>[<index>] notation
  • 20. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 20 SQLScript – What’s New in SPS 11 Spatial Support • SQLScript supports the spatial data type ST_GEOMETRY and SQL spatial functions to access and manipulate the spatial data. • SQLScript also supports the objective style function calls, which is needed for some SQL spatial functions.
  • 21. © 2014 SAP AG or an SAP affiliate company. All rights reserved. 21 SQLScript – What’s New in SPS 11 Injection Prevention Built-In Procedure • There is a danger of SQL injection attack if dynamic SQL statements are used, where the parts of it are derived from untrusted input (e.g. user interface). • ESCAPE_SINGLE_QUOTES(string_var)  used for variables containing a SQL string literal • ESCAPE_DOUBLE_QUOTES(string_var)  used for variables containing a delimited SQL identifier • IS_SQL_INJECTION_SAFE(string_var[, num_tokens])  used to check that a variable contains safe simple SQL identifiers (up to num_tokens, default is 1)
  • 22. © 2015 SAP SE or an SAP affiliate company. All rights reserved. Thank you Contact information Ruediger Karl & Rich Heilman SAP HANA Product Management AskSAPHANA@sap.com