0

I have one stored procedure and it is getting error when I'm uploading the csv or text file using stored procedure.

Can you please help me? How can I write the stored procedure and have one auto-increment column? Please let me know how we will skip unwanted columns using the stored procedure.

CREATE PROCEDURE sp_cat_order_report_gen_meor
begin 
LOAD DATA LOCAL INFILE 'C:\\Users\\VikasK\\Downloads\\vikas\\FINRACATReportableEquitySecurities_EOD.txt'
INTO TABLE tbl_catreportableeqsymbolmaster
FIELDS TERMINATED BY '|' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
SET tbl_catreportableeqsymbolmaster.symbolid =null ;
END 
//
delimiter ;

Please let me know.

7
  • generally you can't use LOAD DATA inside a procedure. If you need other than this please share some sample data with expected result set. Commented Dec 19, 2019 at 6:41
  • Does this answer your question? How to skip columns in CSV file when importing into MySQL table using LOAD DATA INFILE? Commented Dec 19, 2019 at 8:31
  • No its not answer of my question :( Commented Dec 19, 2019 at 8:47
  • OK. Then please expand on your question by supplying sample data from the csv file, the target table definition and a note of the columns you do not wish to load. Commented Dec 19, 2019 at 8:50
  • I have 4 columns , in first column i used auto increment for first column. I need to import the data from csv to table using stored procedure>> >>here i have some data from csv. symbol | issueName| listingExchange | testIssueFlag A | Agilent Technologies Inc.| N | N. please suggest.. Commented Dec 19, 2019 at 8:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.