请问存储过程中下面哪种方式查询性能效率高些:
一:
sqlstr := 'select id,name,sex,address,postcode,birthday from student
where id=:w_id';
open cur_rs for sqlstr using i_id;二:
open cur_rs for select id,name,sex,address,postcode,birthday from
student where id=i_id;
注意是在存储过程中,cur_rs 是结果返回游标,i_id是入参性能优化Oracle存储select
一:
sqlstr := 'select id,name,sex,address,postcode,birthday from student
where id=:w_id';
open cur_rs for sqlstr using i_id;二:
open cur_rs for select id,name,sex,address,postcode,birthday from
student where id=i_id;
注意是在存储过程中,cur_rs 是结果返回游标,i_id是入参性能优化Oracle存储select
绑定变量通常来说性能会好些,但是要看具体应用。有的绑定变量能够提升SQL性能,有的能使SQL性能下降,这样的例子很多,楼主可以百度一下