In MySQL using sqlworkbench, how can I create a procedure for a table to get the input value (only the first 100 rows) from the text file and store it in the database?
For example: in the text the values like (12, abc, heg, 258) like 100 rows.
Please help me with this.
I have tried:
use test;
drop procedure if exists `ptable`;
DELIMITER $$
create definer =`root`@`localhost` procedure `ptable`()
begin
load data local infile 'C:\Documents and Settings\Sridevi\tablevalue.txt'
into table test.testtbl
fields terminated by '|'
lines terminated by '\n'
(sno , city , state , dist, pin )
end $$
DELIMITER ;
but the error like load data is not allowed in the store procedure.
i am using MySQL Workbench..