on 05-01-2018 9:55 AM
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
IMPORT FROM CSV FILE
SQL commands is for local files only, this means your CSV file has to be on the host HANA's machine, more strictly in a specific working folders of $DIR_INSTANCE. If you are able to upload your CSV onto HANA host, then you may need to add your "C:/Users/Desktop" folder into:
SET ('import_export', 'csv_import_path_filter') =
OR disable filtering:
SET ('import_export', 'enable_csv_import_path_filter') = 'false'
More info is here Import CSV into SAP HANA, express edition using IMPORT FROM SQL command
I don't know either if dynamic SQL is accepted in
CREATE PROCEDURE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.