ESQL/C ONLINE 5.0 多库操作问题
ESQL5 ONLINE 5请教各位高手,我现在两个库,D1库有CONN权,有个表T1,D2是我建的,有个表T2,我想在D1查的游标中向D2insert,我是这样写的
....
$database d1
$declare xxx curosr for select zh into $v_zh from t1;
$open xxx
$fetch xxx;
while(sqlca.sqlcode==0)
{
$database d2
$insert into t2 values($v_zh);
$fetch xxx;
}
.....
可是后来出现267错误,WHILE循环中的数据量很少,好象是游标断了,请教,怎么才能实现在一个库查询,在另一个库写,而且游标不释放?????
如能解答,不胜感谢!!~~ 没人回答吗?
回复 2楼 wkl 的帖子
$connect to d1 as "d1" WITH CONCURRENT TRANSACTION;$connect to d2 as "d2" WITH CONCURRENT TRANSACTION;
$set connection "d1";
$declare xxx curosr for select zh into $v_zh from t1;
$open xxx
$fetch xxx;
while(sqlca.sqlcode==0)
{
$set connection "d2";
$insert into t2 values($v_zh);
$set connection "d1";
$fetch xxx;
}
[ 本帖最后由 xxyyy 于 2007-6-27 16:43 编辑 ]
页:
[1]