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
4 answers

Reading Table Type Output in HANA

How can I read the content of an out table type parameter of a procedure in SAP HANA SQL Script? Sample Procedure: create procedure "MYSCHEMA".ReturnTypeTest(out OUTPUT_TABLE "MYSCHEMA"."RESOUT") as begin create local temporary table #temp…
Amiga500
  • 89
  • 1
  • 6
1
vote
3 answers

SQL: SAP Hana if parameter is null, ignore where

I'm passing 3 parameters into my Hana Stored Procedure to use as WHERE clauses, and if the parameter is null, I want the procedure to behave as though that condition doesn't exist. example: if one of the input parameters is deviceType. SELECT TOP 5…
Nishant Roy
  • 1,043
  • 4
  • 16
  • 35
1
vote
2 answers

What is the line continuation character for HANA SQL?

What is the line-continuation character for HANA SQL? Considering I have a super long statement and want it to span across multiple lines instead of it being a super long one in a line. Thanks.
Kawamoto Takeshi
  • 596
  • 1
  • 3
  • 24
1
vote
4 answers

Select multiple rows into a single row

I have a table with the columns "Sequence-ID", "Event-ID", "Value" To one sequence belongs up to 5 events and each event has one value e.g.: |Sequence-ID | Event-ID | Value | |------------|----------|-------| |1 | 1| 7| |1 …
Matthias
  • 461
  • 7
  • 24
1
vote
3 answers

Add days to date in SAP HANA stored procedure

I need to add days to date in HANA stored procedure, but I am getting error message ERROR WHILE parsing DATE/ TIME I use this statement where p_end_date is parameter of my stored procedure. v_end_date_plus := add_days (TO_DATE(' || p_end_date || '…
user4836066
  • 51
  • 1
  • 3
  • 7
1
vote
0 answers

Cast function T-SQL to SQLSCRIPT HANA

I would like to convert code from T-SQL to SQLScript, here is my sample select statement in T-SQL: select cast ( 10 as binary ) Output is: 0x0000A When I write this code in HANA, I get this result: 3130 How can I get this input 0x0000A in Hana? So…
Houssem Hariz
  • 55
  • 3
  • 12
1
vote
1 answer

BETWEEN operator in filter expression

I have to write a condition where I have to check a "DATE" lie beween two other date values as shown in the example: var_out= CE_PROJECTION(:table1,["col1","col2","col3","col4"], ' " col2" BETWEEN "col3" AND "col4" ' ); But this throws me an…
Sangamesh Hs
  • 1,447
  • 3
  • 24
  • 39
0
votes
1 answer

Get value between "," in HANA Database

I have a column with the string "ItemBO:M101,1000129A,A" I want to extract only the text "1000129A" Many thanks in advance! I tried using the function SELECT SUBSTR_AFTER ('ItemBO:M101,1000129A,A',',') "substr after" FROM DUMMY; but the result is…
charj
  • 1
0
votes
1 answer

Informatica Mapping maps null values in Oracle source into single space value in SAP HANA target

Hello StackOverflow community, I am facing a perplexing issue with an Informattica mapping involving an Oracle source DB table and a SAP HANA DB target table. In this mapping , null values from a non-key column in the source table are…
0
votes
2 answers

SQL procedure for dynamic tables

I need to create a dynamic procdedure where I must compare the columns of two tables. The end result SQL looks like this SELECT "ID", "FIELD_1", "FIELD_2", "FIELD_3","FIELD_4","FIELD_5" FROM ( SELECT "ID", "FIELD_1", "FIELD_2", "FIELD_3",…
TrenT
  • 23
  • 4
0
votes
1 answer

HANA SQL Regex finder

Is it possible to get a regex expression back just providing the column name so that HANA database has a look for the most frequent regex itself and returns this? For example the column values are 1, 2, 3, 4, 55, nAn I would expect [1-9] as a…
M__
  • 123
  • 5
0
votes
1 answer

How to Extract Date from the column of type SECONDDATE on Hana DB

We have a table in the HANA DB with two columns of following data types DeliveryDate : SECONDDATE// store values like : 2010-01-11 13:30:00 NewDeliveryDate : Date // will store values like: 2010-01-11 How to write sql script to extract the date…
0
votes
1 answer

Querying for multiple values in multiple columns

How would I search multiple (in this example, say 2) columns for an array of values? For example, here is my table Documents : 1. DocNumber (varchar) 2. CompanyCode (varchar) 3. Data1 (varchar) 4. Data2 (varchar) 5. Data3 (varchar) DocNumber and…
0
votes
1 answer

Why is it Not recommended feature: Using SELECT INTO in Scalar UDF

I have created a user-defined function using this sqlscript. CREATE FUNCTION ZYESTERDAY () RETURNS YESTERDAY VARCHAR(8) LANGUAGE SQLSCRIPT AS BEGIN SELECT TO_DATS(ADD_DAYS(CURRENT_DATE, -1)) INTO YESTERDAY FROM DUMMY; END; Although it…
Lisen
  • 168
  • 1
  • 2
  • 11
0
votes
0 answers

Call HANA stored procedure from SQL Server with Dynamic Parameter

I have a stored procedure in SAP HANA database, I run the same with following code { EXEC ('call schema_name.sp_name (''p1 value'',''p2 value'')') AT hana_linked_server_name } It works with the fix value of Parameter. But I want the same to run…
AkJ
  • 1
  • 1