[solved] Error in ZSqlProcessor
Posted: 30.10.2012, 18:15
Mysql 5.1 Lazarus 1.0.2
http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing rev 1943
Error in code
With this procedure error
http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing rev 1943
Error in code
Code: Select all
FormMain.ZSQLProcessorUpload.Script.Clear;
FormMain.ZSQLProcessorUpload.Script.Add('call proc_del_data_to_ram_table_sklad (618);');
FormMain.ZSQLProcessorUpload.Execute;
Code: Select all
CREATE PROCEDURE maximator.proc_del_data_to_ram_table_sklad(IN sklad_id INT)
SQL SECURITY INVOKER
COMMENT 'Удаление позиций склада из RAM таблицы'
BEGIN
declare count_ INTEGER;
DECLARE shag INTEGER;
DECLARE i INTEGER ;
declare command_ VARCHAR(255);
SELECT
count(result_table_ram.id) as count_
FROM
result_table_ram where (id_sklad_postavshika=sklad_id) INTO count_ ;
if count_>0 THEN
SET shag=5000;
set i=(count_ DIV shag)+1;
REPEAT
SET @command_=concat('DELETE FROM result_table_ram where id_sklad_postavshika=',sklad_id,' LIMIT ',shag);
prepare exec_command from @command_;
EXECUTE exec_command ;
SET i=i-1;
UNTIL i<=0
END REPEAT;
end if;
END