找回密码
 注册成为天翎用户
楼主: lichengpr

[已解决] SQL 视图能否支持参数

[复制链接]
sophie 发表于 2013-10-8 14:32:30 | 显示全部楼层
您好,请问您的kq_checkinout_pkg是表空间名么?还有请您在数据库客户端执行一下您所写的存储过程,看能否正常执行出结果集。
 楼主| lichengpr 发表于 2013-10-8 15:24:22 | 显示全部楼层
kq_checkinout_pkg 是包的名字,存储过程就是一条SQL语句啊
 楼主| lichengpr 发表于 2013-10-8 15:26:43 | 显示全部楼层
一开始var datefrom = getItemValueAsDate("_日期从");
是没有值的,只有datefrom 有值才执行存储过程
sophie 发表于 2013-10-8 15:46:10 | 显示全部楼层
您好,您把您的存储过程修改一下,再执行看是否能执行。
procedure kq_report_a(p_date_from varchar2,
                        p_date_to   varchar2,
                        c_ref       out t_cursor) is
      sqlstr varchar2(1000);
  begin
  sqlstr :='select * from tlk_敬业过程表单 t
       where to_char(t.item_日期, ''YYYY-MM-DD'') >= '''|| p_date_from ||'''
         and to_char(t.item_日期, ''YYYY-MM-DD'') <= '''|| p_date_to ||'''';
    open c_ref for sqlstr;
end kq_report_a;
 楼主| lichengpr 发表于 2013-10-8 15:56:52 | 显示全部楼层
没有用,后台报错是:

Hibernate: select stylerepos0_.ID as ID14_0_, stylerepos0_.LASTMODIFYTIME as LASTMODI2_14_0_, stylerepos0_.VERSIONS as VERSIONS14_0_, stylerepos0_.CONTENT as CONTENT14_0_, stylerepos0_.NAME as NAME14_0_, stylerepos0_.SORTID as SORTID14_0_, stylerepos0_.APPLICATIONID as APPLICAT7_14_0_ from T_STYLEREPOSITORY stylerepos0_ where stylerepos0_.ID=?
Hibernate: select * from ( select stylerepos0_.ID as ID14_, stylerepos0_.LASTMODIFYTIME as LASTMODI2_14_, stylerepos0_.VERSIONS as VERSIONS14_, stylerepos0_.CONTENT as CONTENT14_, stylerepos0_.NAME as NAME14_, stylerepos0_.SORTID as SORTID14_, stylerepos0_.APPLICATIONID as APPLICAT7_14_ from T_STYLEREPOSITORY stylerepos0_ where stylerepos0_.ID='null' ) where rownum <= ?
java.lang.NullPointerException
        at cn.myapps.core.dynaform.view.html.ViewHtmlBean.toHTMLText(ViewHtmlBean.java:759)
        at org.apache.jsp.portal.default_.dynaform.view.detail_jsp._jspService(detail_jsp.java:846)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
sophie 发表于 2013-10-8 17:29:09 | 显示全部楼层
您先在客户端执行呀,结果是否能正常执行呢?
 楼主| lichengpr 发表于 2013-10-8 17:37:13 | 显示全部楼层
可以正常执行
sophie 发表于 2013-10-8 18:54:35 | 显示全部楼层
您好,我们明天远程看一下吧
 楼主| lichengpr 发表于 2013-10-9 08:15:29 | 显示全部楼层
QQ 841871160
 楼主| lichengpr 发表于 2013-10-9 09:57:49 | 显示全部楼层
已解决,谢谢

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-9-27 05:01

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表