MySQL Forums
Forum List  »  Events (Job Scheduler)

my sql store procedure
Posted by: Praveen raja
Date: December 16, 2013 04:47AM

hi,
i am using mysql benchmark. i have to do a task.
create a table and write a procedure to read 10 from textfilnd load them to the created table

i used the query
use test;
DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `p_table`()
BEGIN
LOAD DATA LOCAL INFILE "D:/tablevalue.txt"
INTO TABLE new_table
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n';

END $$

DELIMITER ;


but error like load data is not allowed in Store procedure
and then i used the query

use test;
drop procedure if exists `proctable`;
DELIMITER $$

create definer =`root`@`localhost` procedure `proctable`()
begin

do sys_exec(concat('perl LOAD_DATA_INFILE.pl test.new_table ', 'D:\tablevalue.txt'));

end $$

DELIMITER ;

but data is not uploading from the file to the table


please help me on this.
if is there any other option let me know

Options: ReplyQuote


Subject
Views
Written By
Posted
my sql store procedure
2896
December 16, 2013 04:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.