type curs is ref cursor;动态游标
cu3 curs;
open cu3 for 'select code_segment_start,code_segment_length,code_zone_id from zc.t_gx_rule_detail where field_id='||v_field_id;
loop
fetch cu3 into v_code_segment_start,v_code_segment_length,v_code_zone_id;
exit when cu3%notfound;我想问下,我用动态游标,想从数据表中取出 field_id=v_field_id.的记录,这样写有问题吗?
我这样写运行的时候抱"无效列名"的错误
请哪位大哥帮帮我
cu3 curs;
open cu3 for 'select code_segment_start,code_segment_length,code_zone_id from zc.t_gx_rule_detail where field_id='||v_field_id;
loop
fetch cu3 into v_code_segment_start,v_code_segment_length,v_code_zone_id;
exit when cu3%notfound;我想问下,我用动态游标,想从数据表中取出 field_id=v_field_id.的记录,这样写有问题吗?
我这样写运行的时候抱"无效列名"的错误
请哪位大哥帮帮我
select code_segment_start,code_segment_length,code_zone_id from zc.t_gx_rule_detail where field_id=1;
有没有错误?
就这样说好来:就是我要查询一个表t_X.通过条件id=condition1
返回一个cursor
我该怎么写啊?我是这样写的
type curs is ref cursor;
cu3 curs;
tmp tX%rowtype;
begin
open cu3 for 'select * from t_X where id='||condition1||'';
loop
fetch cu3 into tmp;
exit when cu3%notfound;
....end loop;
open cu3 for 'select code_segment_start,code_segment_length,code_zone_id from zc.t_gx_rule_detail where field_id=001';正确,有多条记录返回