Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Inserting an Array to a table in SAP HANA database

Is there a way to insert an Array to a table in HANA database? I have an array of EMPL_ID with multiple skill set referred by SKILL_ID. I have written below code

CREATE COLUMN TABLE "EMPL"."Skill_Id" (
   "EMPL_Id"integer,
   "SKILL_Id"integer array
);
INSERT INTO "EMPL"."Skill_Id" VALUES ( 210, array(2,3,5,6));

However the output is coming as: 

|    EMPL_Id      |            Skill_Id                             |
|      210        |040000000102000000010300000001050000000106000000 |

Whereas I am expecting below code

|EMPL_Id | Skill_Id |
|  210   |    2     |
|  210   |    3     |
|210|4 |
|210|5 |


1 Answer
Arushi

As far as I know, there is no direct way of inserting an Array using SQL query. You will first have to combine the columns (EMPL_Id + Skill Id) using the code and then do a bulk insert to the database.

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.