Questions tagged [hana-sql-script]

The language for stored procedures and functions used in SAP HANA

SAP HANA SQL-Script is a collection of extensions to SQL. With those extensions you can create database procedures which will be stored on the SAP HANA database.

You can use sql-script via SAP-HANA-Studio which is an extension to eclipse.

Useful Links

151 questions
1
vote
1 answer

Update 2 joined tables simultaneously on HANA?

Can I update 2 columns from 2 tables joined by foreign key with one statement in SAP HANA
Bongo
  • 333
  • 3
  • 12
1
vote
2 answers

SQL Date Range Specification, Explicit vs BETWEEN()

My understanding of SQL is that WHEN reading_start_dt BETWEEN '2020-02-09' AND '2020-02-15' is the same as WHEN reading_start_dt >= '2019-02-09' AND reading_start_dt <= '2019-02-15' But I'm getting completely different ResultSets when the only…
1
vote
1 answer

How can I query a NCLOB column as a table in SAP HANA?

I like to do a select query with a where condition on a column of type NCLOB let's call it information column. It has following format: { "firstName" : "name1", "lastName" : "lastName1" } I want to do some thing like this Select * from…
Sarah Jeffi
  • 53
  • 2
  • 10
1
vote
2 answers

Extreme values within each group of dataset

I have an SQLScript query written in AMDP which creates two new columns source_contract and target_contract. RETURN SELECT client as client, pob_id as pob_id, dateto as change_to, datefrom as change_from, cast( cast( substring( cast(…
1
vote
1 answer

Execute a THEN clause where WHEN is false

An error occurs in the code of THEN clause when a UDF is used in the WHEN clause, despite the fact that the function returns false. -- a simple function for example CREATE FUNCTION "is_one" ( IN checkNum INTEGER ) RETURNS is_one…
1
vote
1 answer

SAP HANA Equivalent logic to Try_Cast

In SQL Server you have a function called Try_Cast. https://learn.microsoft.com/en-us/sql/t-sql/functions/try-cast-transact-sql?view=sql-server-2017 I like that you can put this into a Case statement: SELECT CASE WHEN TRY_CAST('test' AS float) IS…
ThomasRones
  • 657
  • 8
  • 29
1
vote
1 answer

Memory Size in Delta after Delta Merge

On my HANA database, I executed delta merge on a few tables that I had executed a number of INSERT statements I see that the merge command is completed successfully On the other hand, when I query M_CS_TABLES table, I see that the…
Eralper
  • 6,461
  • 2
  • 21
  • 27
1
vote
2 answers

How to pass single-column table to AMDP method?

I need to pass a table with a single column to an AMDP method which throws the error, the other parameters go fine: TYPES: BEGIN OF s_so_i, parent_key TYPE snwd_so_i-parent_key, product_guid TYPE snwd_pd-node_key, …
András
  • 1,326
  • 4
  • 16
  • 26
1
vote
1 answer

Dynamic SQL Syntax Error SQLScript SAP HANA

I have dynamic SQL in a Stored Procedure. The procedure takes three parameters: DimPartialName ColumnName UploadID Here is the procedure: PROCEDURE "Schema"."DeletefromDIM" (In DimPartialName NVARCHAR(50), In IDColumnName NVARCHAR(50), IN…
ThomasRones
  • 657
  • 8
  • 29
1
vote
1 answer

Split text holding numbers at fixed position but not in middle of number

I have a table with a column LIST_OF_NUMBERS containing the following strings: 10, 20, 395, 443, 534, 734, 954, 105, 156 I want to truncate the LIST_OF_NUMBERS column to 10 characters as follows: LEFT(LIST_OF_NUMBERS,10) 10, 20, 39 However, if a…
Boy12343
  • 75
  • 3
  • 10
1
vote
1 answer

HANA Calc View Place Holder usage when joining in Table Function or Stored Procedure

HANA Version: SP12 All, I've successfully created Calc Views with INPUT_PARAMETERS as described by Lars in many blogs and forums. While these views work without issue when querying directly for single and multi inputs, I'm encountering an issue…
Dakota H.
  • 11
  • 3
1
vote
1 answer

How to return CHAR30 in AMDP?

I try to create an AMDP method that returns a single field that would be SNWD_COMPANY_NAME on the ABAP side. The documentation says only table types and elementary types can be returned. SNWD_COMPANY_NAME is not elementary, it is CHAR 80, but I…
András
  • 1,326
  • 4
  • 16
  • 26
1
vote
2 answers

When to use HANA SPs instead of graphical Calculation views?

I didn't come across in any such scenario where we have to use stored procedure instead of Calculation View, but I read many sites where it is mentioned. One can use Stored Procedure in complex scenarios, but I am confused which scenarios are…
1
vote
4 answers

How to club the non-null values in the rows in SQL

I have the following situation: COL_1 COL_2 COL_3 COL_4 COL_5 COL_6 COL_7 5678 ? ? ? ? ? ? ? 6789 ? ? ? ? ? ? ? 1223 ? ? ? ? ? ? …
Muskaan
  • 55
  • 2
  • 9
1
vote
2 answers

How to select rows which have same set of values in two columns and hence concatenate the values in the third column?

Attached Image I have the sample values as shown in the image attached. What I want to achieve is that the value of PR_NUMBER field gets concatenated on the basis of same values in PO_NUMBER and PO_ITEM. Though this is a sample data, any n number of…
1 2
3
10 11