Showing posts with label sqlscript. Show all posts
Showing posts with label sqlscript. Show all posts

Tuesday, 11 July 2017

PIVOT Data in HANA

In my previous blog I have covered how to UNPIVOT data in HANA, in this blog I am covering how to PIVOT data in HANA.

While converting MS-SQL procedures into HANA procedures, we came across PIVOT statement in one of the select query, unfortunately HANA SQL Script does not support PIVOT operation hence we had to come up with alternative approach. In this blog I will cover two approaches to PIVOT data in HANA
  1. Using graphical calculation view
  2. Using HANA SQL Script

Saturday, 10 June 2017

SAP HANA ABAP: SQLScript: Functions Part-1

The Goal of AMDP implementation is always to remove any additional logic required at the abap layer i.e. avoid loops, further joins, formatting or data conversions. To achieve this, we can leverage HANA SQL functions to ensure the that the data being returned from AMDP is complete and needs zero or a light touch while passing to the ABAP Layer.

Using the below explained functions we as a HANA developer can make our lives easier.

Friday, 2 September 2016

Upload and Retrieve Image using SAP HANA XS & SAP UI5

One of the most common use case in building XS based Native HANA Application is working with file uploads like image, csv etc.,
In this blog I will explain how to:
  1. Use SAPUI5 File Uploader to upload an image
  2. Render preview of the uploaded image
  3. Save it to HANA DB using a XSJS service.
  4. Retrieve the saved image using XSJS service and render it on the UI.
Please note this approach can be applied for any type of file. e.g .csv, xlsx etc.,
Upload an Image using SAPUI5 File Uploader:

Thursday, 18 August 2016

First Steps of Code Quality Analysis for SAP HANA SQLScript

One of these is SAP HANA SQLScript, which is used to develop high-performance stored procedures for the SAP HANA in-memory database. Unfortunately, SAP did not provide any static code analysis for SQLScript (in contrast to SAP Code Inspector for ABAP). Moreover, there are no precise guidelines how to develop good SQLScript code so far. In this post I'll present our initial thoughts on assessing the code quality of SQLScript.

The starting point to identify relevant static checks was the SAP HANA SQLScript Reference, which already mentions some (very general) best practices (chapter 13). Some of the recommendations there are very easy to detect automatically, e.g.

Monday, 8 February 2016

Getting flexible with SAP HANA

Most of you might not be aware of a feature introduced on SAP HANA SPS5. This new feature is called "Flexible Tables", which means that you can define a table that will grow depending on your needs. Let's see an example...

You define a table with ID, NAME and LAST_NAME. The table works fine, but you realize that you need to also add the PhoneNumber and Address...in a normal situation, you will need to open the definition and add those fields...but using Flexibles Tables, you will need to only add those fields as part of the INSERT query and let SAP HANA do it's magic...

Of course, that scenario is very unlikely to happen, because for a couple of fields, it doesn't make sense...so...where do we use this Flexible Tables? Enterprise Search, were we need to have all products on one table, and this table can have a really big amount of columns...as different products will have different characteristics...

So...for this blog...I really break my head trying to find a simple scenario that could cover Flexible Tables...what I came up with? SAP HANA, Flexible Tables, R and Twitter...

The code is very complex, so I'm not going to explain line by line how it works...but of course, I'm going to give a nice overview...