在声明游标之前,我需要调用存储过程。该存储过程会填充一个表格,然后游标将循环遍历这些表格行。但是Workbench不允许在declare
语句之前调用存储过程或其他任何内容。
create definer=`root`@`%` procedure `usp_tesst`()
begin
declare ordid int;
declare packid int;
declare cstmid int;
declare deltimespanid int;
declare dstrcid int;
declare pcstatus tinyint(1);
declare deliverytime datetime;
declare maxdate datetime;
declare temppackcount int default(0);
call usp_createtemppackages;
-- it says there is a syntax error in here
declare crs cursor for
select * from temppackages....
我应该如何称呼这个sp?