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
0
votes
1 answer

Partial Data deletion from SLT table

I need to delete the data from VBFA table which is an SLt table. We need to delete the data till Oct 2017. How we can achieve this as only date filed we have is MJAHR which is Material document year and ERDAT date on which record is created. How we…
0
votes
2 answers

Using REPLACE_REGEXPR in BW transformation throws syntax error

I'm trying to implement a routine for replacing some invalid characters in a BW transformation. But I keep getting a syntax error. This is my current code: METHOD S0001_G01_R40 BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY. --…
Renato
  • 15
  • 1
  • 7
0
votes
1 answer

Is there a better way to code below SQL using Case within Select?

I have the below sql in my procedure, but it is giving "single-row query returns more than one row" error when I use Case within a Select. so I split the query into multiple Selects and finally writing the output by union of all the temp tables I…
0
votes
0 answers

Capping Window Function SUM to not go below zero

I'm trying to set up a cumulative inventory function, where for each material I'm trying to calculate future inventory. Because of imbalance with orders, I might have cases where the rolling sum might go below zero. I'd like to avoid these, cap the…
gilliali
  • 13
  • 4
0
votes
1 answer

How to create a "history" table in calaculation view for each day based on "time dimension"

I have very HANA/SQLScript specified problem. I need to create a history view for each day in form of scripted calculation view based on table with dates gaps? I tried every cross joins with "_SYS_BI"."M_TIME_DIMENSION" and just use Functions. In…
Lukas Idz
  • 1
  • 1
0
votes
1 answer

Identiy missing rows and calculate them in SQL

I have the follwing data. Need to identify the missing rows and calculate the average LineNo Field1 Field2 Year Average 1  France Paris 2019 100  2  France Paris 2017 300  3  France Nice 2018 200  4  Italy  Rome 2019 50  5  Italy …
Robert
  • 61
  • 2
  • 8
0
votes
1 answer

SAP HANA Stored Procedure optional output parameter with text type

Let's imagine that I have created the stored procedure in SAP HANA database and would like to have optional out parameter with text type, like error details. As I have read to achieve this I should use some default value thus I have done like…
Rufi
  • 2,529
  • 1
  • 20
  • 41
0
votes
1 answer

Pass CLOB to system procedure SAP HANA

How do I pass a clob to system procedure without getting an error? I am trying to pass: CALL SYS.GET_PROCEDURE_OBJECTS(CREATE PROCEDURE "IA_ATP"."ia_xsjob.xsjob_procedures_folder::atp_procedure" ( ) LANGUAGE SQLSCRIPT SQL…
LearningHero
  • 41
  • 2
  • 6
0
votes
1 answer

SQL Join by comparing measures or loop with cursors?

In order to verify if Deliveries are done on time, I need to match delivery Documents to PO schedule lines (SchLin) based on the comparison between Required Quantity (ReqQty) and Delivered Quantity (DlvQty). The Delivery Docs have a reference to the…
0
votes
1 answer

HANA SQL Script INSERT INTO with INNER JOIN can't insert values

I'm quite new to SQL and hope you can help me with my problem. I have a table called Order_Status_Form_3 with the columns Order_ID (KEY), Customer_ID, Customer_Unique_ID, Status(KEY) and Date. The table is filled, except for the Customer_Unique_ID…
0
votes
1 answer

Insert CSV Blob Data via SQL

I'm trying to explore different methods for inserting very large (10 million rows) CSV-Data from a File into the SAP HANA Database (version 1.12). We've tried many things so far (some more successful then others) and right now I'm stuck at the…
jriedel
  • 13
  • 1
  • 5
0
votes
3 answers

How to INSERT the continuous Date in HANA with SQL statement?

I have to insert the data like as below from 01-01-2018 to 31-12-2018. insert into "schema"."tablename" (FISCAL_DATE,FISCAL_DT,REGION_CD,FISCAL_REGION_CD,FISCAL_DATE1,NEW_REGION_CD) values ('2018-01-01', '2018-01-01','EMEA','EUR','01/01/2018',…
0
votes
0 answers

Dynamic work around for pivot function in hana

I have a table that consists of the below: Emp ID | Earning Type | Value But instead of showing the employee in a # of lines based on the # of earning types they have i want to display all in one line dynamically. I am aware i can do it with…
0
votes
2 answers

Conditional SQL queries with SQL Script

I have two example tables: TABLE1: ID | COLUMN_B| COLUMN_C _________|_________|_________ 1 | 0 | 1 ________|_________|_________ 2 | 0 | 1 ________|_________|_________ 3 | 0 | …
Nicole
  • 107
  • 1
  • 2
  • 12
0
votes
2 answers

Conditional update on HANA Studio (SQLScript) trigger

I would like to write a trigger on HANA Studio using SQLScript to update COLUMN_E from TABLE2 when COLUMN_B from TABLE1 is updated to a specific value (let's say, 100). Rows from table 1 are referenced in table 2 with the first column (ID). I have…
Nicole
  • 107
  • 1
  • 2
  • 12