- 论坛徽章:
- 0
|
begin atomic
declare p_custmgr integer ;
declare temporary table t_custmgr
(custmgr integer not null default 0,customerid INTEGER not null default 0);
declare c_c1 cursor for
select distinct custmgr from em.t_comm_customer where status=0 order by custmgr;
set p_custmgr=0;
open c_c1 ;
fetch from c_c1 into p_custmgr;
while (at_end<>-1) do
insert into t_custmgr
select distinct p_custmgr,a.customerid from T_VISITSALES_ORDER a
where a..customerid =p_custmgr order by rand() fetch first 10 rows only;
fetch from c_c1 into p_custmgr;
end while;
close c_c1;
select * from t_custmgr;
end@
[IBM][CLI Driver][DB2/AIX64] SQL0104N An unexpected token "t_custmgr" was found following "lare temporary table". Expected tokens may include: "<SQL_variable_condition_declaration>". LINE NUMBER=1. SQLSTATE=42601
是什么问题。我写的有问题吗? |
|