Hi,
I am new to memSQL and trying to create a procedure which will load the data in a table from the file.
I am facing error as shown below while trying to run the procedure. The procedure is compiled but execution is showing issues.
Can you please suggest where I am going wrong.
- Procedure definition
DELIMITER //
CREATE PROCEDURE SP_LOAD_TEST_TABLE_PROC1(v_file_path VARCHAR(100)) AS
BEGIN
LOAD DATA INFILE ‘’‘v_file_path’’’ INTO TABLE frm_crisp.TEST_TABLE_PROC1
FIELDS TERMINATED BY ‘,’
LINES TERMINATED BY ‘\n’ ;
END //
DELIMITER ;
-
Proc execution
call SP_LOAD_TEST_TABLE_PROC1(’/ms/user/r/ramanman/CRISP/CRISP_FMS_AGGREGATE_Copy.csv’); -
I am getting below error
memsql> call SP_LOAD_TEST_TABLE_PROC1(’/ms/user/r/ramanman/CRISP/CRISP_FMS_AGGREGATE_Copy.csv’);
ERROR 1017 (HY000): Unhandled exception
Type: ER_FILE_NOT_FOUND
Message: Can’t find file: ‘‘v_file_path’’ (errno: 2)
Callstack:
#0 Line 4 infrm_crisp
.SP_LOAD_TEST_TABLE_PROC1
-
I tried changing the LOAD DATA part in the proc with the below, but this is also showing same issue
LOAD DATA INFILE ‘’’||v_file_path||’’’ INTO TABLE frm_crisp.TEST_TABLE_PROC1
LOAD DATA INFILE CONCAT(’,v_file_path,’) INTO TABLE frm_crisp.TEST_TABLE_PROC1
Thanks in advance