Example of using Text join in SAP HANA

SAP HANASAPSAP Basis

To implement Text join, create a table −

CREATE COLUMN TABLE TEST.P_INFO (PROD_ID BIGINT, P_CAT NVARCHAR(50));
INSERT INTO TEST.P_INFO VALUES (11,’FURNITURE’);
INSERT INTO TEST.P_INFO VALUES (14,’ELECTRONICS’);
INSERT INTO TEST.P_INFO VALUES (25,’FURNITURE’);
INSERT INTO TEST.P_INFO VALUES (76,’ELECTRONICS’);

2nd table −

CREATE COLUMN TABLE TEST.PROD_DESC (PROD_ID BIGINT,LANGUAGE NVARCHAR(10), DESCR NVARCHAR(100));
INSERT INTO TEST.PROD_DESC VALUES (11,’E’,’Table’);
INSERT INTO TEST.PROD_DESC VALUES (11,’D’,’Chair’);
INSERT INTO TEST.PROD_DESC VALUES (14,’E’,’32 LED’);
INSERT INTO TEST.PROD_DESC VALUES (14,’D’,’32 inch LCD’);
INSERT INTO SAP_STUDENT.PRODUCT_DESC VALUES (25,’E’,’Comp Table’);
INSERT INTO SAP_STUDENT.PRODUCT_DESC VALUES (25,’E’,’Mixer’);

Note that it should have LANGUAGE Column which should have values as single letters like ‘E’ for English and ‘D’ German, etc.



raja
Published on 05-Feb-2018 15:50:50
Advertisements