hana

How to convert SQL Unpivot query to HANA SQL?

匆匆过客 提交于 2021-02-15 07:43:43
问题 How to convert following SQL Server query which uses unpivot to a HANA SQL query. SELECT p.CardName, REPLACE(p.groupcode1, 'QryGroup', '') groupcode1, ocqg.GroupName FROM ocrd UNPIVOT (value FOR groupcode1 IN ([QryGroup1], [QryGroup2], [QryGroup3], [QryGroup4], [QryGroup5], [QryGroup6], [QryGroup7], [QryGroup8], [QryGroup9], [QryGroup10], [QryGroup11], [QryGroup12], [QryGroup13], [QryGroup14], [QryGroup15],[QryGroup16], [QryGroup17], [QryGroup18], [QryGroup19],[QryGroup20], [QryGroup21],

How do I found out the Host/Port when connecting to SAP HANA using python PyHDB

烈酒焚心 提交于 2021-02-11 16:40:46
问题 I'm trying to connect to a SAP HANA database, but I don't know where to find the host or port attributes for pyhdb.connect() Test Code Below import pyhdb connection = pyhdb.connect( host="", port="", user="exampleusername", password="examplepassword" ) cursor = connection.cursor() cursor.execute("SELECT 'Hello Python World'") cursor.fetchone() connection.close() Can someone please point me in the right direction? 回答1: HOST , PORT and DATABASENAME are part of the SAP HANA logon information,

How do I found out the Host/Port when connecting to SAP HANA using python PyHDB

穿精又带淫゛_ 提交于 2021-02-11 16:40:38
问题 I'm trying to connect to a SAP HANA database, but I don't know where to find the host or port attributes for pyhdb.connect() Test Code Below import pyhdb connection = pyhdb.connect( host="", port="", user="exampleusername", password="examplepassword" ) cursor = connection.cursor() cursor.execute("SELECT 'Hello Python World'") cursor.fetchone() connection.close() Can someone please point me in the right direction? 回答1: HOST , PORT and DATABASENAME are part of the SAP HANA logon information,

Can't bind property from model to control on XML view

半城伤御伤魂 提交于 2021-02-08 10:40:20
问题 I trying to migrate my app on new version of Openui5 (1.48) and have some problems with model bindings. I am using sap.ui.getCore().setModel(oModel, "local") for model declaration and when I trying to bind some controls to values from this model like this: <Text text="{local>/count}"/> value isn't displayed but if I will get this model, set it to view in controller and remove > from xml var oModel = sap.ui.getCore().getModel("local"); this.getView().setModel(oModel); XML <Text text="{/count}"

How to Unpivot in SQL? (SAP HANA) (Columns to rows)

。_饼干妹妹 提交于 2021-01-28 17:54:41
问题 I need to unpivot some data in SAP HANA. I set up an example table to try it out on, but I still can't get anywhere. The actual table contains 1000's of ID's and ~50 columns, but I want to do this for many tables, so while I can specify the FieldNames(Original Columns), it would be nice to have an automated solution. Here is the example table I setup: I would like to get the results into this form: Note: The '?' represents NULL. To create the example table: create local temporary table

How to Unpivot in SQL? (SAP HANA) (Columns to rows)

我的未来我决定 提交于 2021-01-28 17:49:24
问题 I need to unpivot some data in SAP HANA. I set up an example table to try it out on, but I still can't get anywhere. The actual table contains 1000's of ID's and ~50 columns, but I want to do this for many tables, so while I can specify the FieldNames(Original Columns), it would be nice to have an automated solution. Here is the example table I setup: I would like to get the results into this form: Note: The '?' represents NULL. To create the example table: create local temporary table

How to Unpivot in SQL? (SAP HANA) (Columns to rows)

无人久伴 提交于 2021-01-28 17:46:54
问题 I need to unpivot some data in SAP HANA. I set up an example table to try it out on, but I still can't get anywhere. The actual table contains 1000's of ID's and ~50 columns, but I want to do this for many tables, so while I can specify the FieldNames(Original Columns), it would be nice to have an automated solution. Here is the example table I setup: I would like to get the results into this form: Note: The '?' represents NULL. To create the example table: create local temporary table

SAP HANA SQL Query to find all possible combinations between two columns

廉价感情. 提交于 2021-01-07 01:36:37
问题 The target is to create all possible combinations of joining the two columns using SAP HANA SQL . every article of the first column ('100','101','102','103') must be in the combination result. Sample Code create table basis (article Integer, supplier VarChar(10) ); Insert into basis Values (100, 'A'); Insert into basis Values (101, 'A'); Insert into basis Values (101, 'B'); Insert into basis Values (101, 'C'); Insert into basis Values (102, 'D'); Insert into basis Values (103, 'B'); Result

Errors with declared array/table variable values in SAP HanaDB SQL

*爱你&永不变心* 提交于 2021-01-05 07:35:40
问题 I am trying to add a declared variable to replace a hardcoded list of values in a "where in" clause. Researching how Hana handles array variables it seems like I can do this by declaring an array and then either using a select directly on it or by unnesting it first into a table but I keep getting errors I can't resolve. When I try it this way: DO BEGIN DECLARE CODES_ARRAY NVARCHAR(100) ARRAY = ARRAY('01','02','03','04'); SELECT T0."ItemCode" FROM OITM T0 INNER JOIN OITW T1 ON T0."ItemCode" =

Errors with declared array/table variable values in SAP HanaDB SQL

你说的曾经没有我的故事 提交于 2021-01-05 07:32:53
问题 I am trying to add a declared variable to replace a hardcoded list of values in a "where in" clause. Researching how Hana handles array variables it seems like I can do this by declaring an array and then either using a select directly on it or by unnesting it first into a table but I keep getting errors I can't resolve. When I try it this way: DO BEGIN DECLARE CODES_ARRAY NVARCHAR(100) ARRAY = ARRAY('01','02','03','04'); SELECT T0."ItemCode" FROM OITM T0 INNER JOIN OITW T1 ON T0."ItemCode" =