Skip to Content
0
Former Member
May 01, 2018 at 08:55 AM

How to Import data from a CSV file available in Data base to HANA table with HANA procedure

677 Views Last edit May 08, 2018 at 05:37 AM 2 rev

Hi All,

I have a requirement to read a data from a CSV file which is place in Data base and store in HANA table. After reading multiple blogs I came to know we can use Import statement.

But I am getting Error: feature 'ImportExport.Import' is disabled. So I tried to modify the Configuration with the help of ALTER Configuration command but did not worked. It gave error general error: change not allowed for tenant database

I am trying this on Trail MDC Database.

Please find the Code Snippet and let me know is there any solution for this.

CREATE PROCEDURE "TRAIL"."Test3"() LANGUAGE SQLSCRIPT AS BEGIN EXEC 'IMPORT FROM CSV FILE ''C:/Users/Desktop/zone1.csv'' INTO "EMPLOYEEINFO" WITH RECORD DELIMITED BY ''\n'' FIELD DELIMITED BY '','''; END

and with Control file:

CREATE PROCEDURE "SYSTEM"."Trail::Home1" ( ) LANGUAGE SQLSCRIPT AS BEGIN EXEC 'ALTER SYSTEM ALTER CONFIGURATION (''indexserver.ini'', ''SYSTEM'') set (''import_export'', ''enable_csv_import_path_filter'') = ''true'' with reconfigure' ; EXEC 'ALTER SYSTEM ALTER CONFIGURATION (''indexserver.ini'', ''SYSTEM'') set (''import_export'', ''csv_import_path_filter'') = ''/'' with reconfigure'; EXEC 'IMPORT ''data.ctl'''; END