求助动态游标问题
时间:2011-09-14
来源:互联网
没有找到解决办法。所以求助各位高手帮忙看下,
我把'select t.start_date '||' to '||' t.end_date, 这个地方改成select t.start_date 这样一个字段
就好用了。所以我怀疑是连接字符串这的毛病。可是业务需要这样,没找到解决办法。
create or replace package body AL_REPORT_FIRST is
procedure get_price(p_starttime in varchar2,
p_endtime in varchar2,
p_startcity in char,
p_endcity in char,
p_recursor out sys_refcursor)
is
begin
open p_recursor for
'select t.start_date '||' to '||' t.end_date,
t.dep_location,
t.arr_location,
t.cost
from LDATA.al_ticket_surcharge_t t
where t.dep_location=:1
and t.arr_location=:2
and t.start_date>:3
and t.end_date<:4'
using p_startcity,p_endcity,p_starttime,p_endtime;
end;
end AL_REPORT_FIRST;
作者: yumingde 发布时间: 2011-09-14
作者: 昨夜袜子 发布时间: 2011-09-14
作者: jboracle1981 发布时间: 2011-09-14
作者: yumingde 发布时间: 2011-09-14
代码如下:
create or replace package body AL_REPORT_FIRST
is
procedure get_price(p_starttime in varchar2,
p_endtime in varchar2,
p_startcity in char,
p_endcity in char,
p_recursor out sys_refcursor)
is
begin
open p_recursor for 'select t.start_date || :0 || t.end_date,
t.dep_location,
t.arr_location,
t.cost
from LDATA.al_ticket_surcharge_t t
where t.dep_location=:1
and t.arr_location=:2
and t.start_date>:3
and t.end_date<:4'
using 'to', p_startcity, p_endcity, p_starttime, p_endtime;
end;
end AL_REPORT_FIRST;
[ 本帖最后由 bell6248 于 2011-9-14 16:26 编辑 ]
作者: bell6248 发布时间: 2011-09-14
真是让我汗颜啊,我咋就没想到呢。
作者: yumingde 发布时间: 2011-09-14
[ 本帖最后由 ccceleven 于 2011-9-14 16:32 编辑 ]
作者: ccceleven 发布时间: 2011-09-14
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28