起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 280|回复: 16

【结贴】运行存储过程测试的时候发生的异常

[复制链接]
发表于 2007-9-11 10:08:14 | 显示全部楼层 |阅读模式
with TStoredProc.Create(nil) do
      try
        Connection := lConnection;
        StoredProcName := 'SP_BBTJ_INSERT_STAT_RECORD';
        Params.Clear;
        //统计单位
        Params.CreateParam(TFieldType.ftString, 'as_tjdw', TParamType.ptInput);
        //统计年月
        Params.CreateParam(TFieldType.ftString, 'as_tjny', TParamType.ptInput);
        //统计范围定义
        Params.CreateParam(TFieldType.ftString, 'as_tjfwdy', TParamType.ptInput);
        //是否清除统计进度,重新统计
        Params.CreateParam(TFieldType.ftInteger, 'ab_reset', TParamType.ptInput);
        //统计提交人
        Params.CreateParam(TFieldType.ftString, 'as_username', TParamType.ptInput);
        //统计进度标志
        Params.CreateParam(TFieldType.ftString, 'as_progress', TParamType.ptInput);
        //统计进度说明
        Params.CreateParam(TFieldType.ftString, 'as_progress_info', TParamType.ptInput);
        //统计附加参数
        Params.CreateParam(TFieldType.ftString, 'as_parm', TParamType.ptInput);
        //备注
        Params.CreateParam(TFieldType.ftString, 'as_comment', TParamType.ptInput);
        //返回值
        Params.CreateParam(TFieldType.ftInteger, 'ai_return', TParamType.ptOutput);
        //错误信息
        Params.CreateParam(TFieldType.ftString, 'as_errmsg', TParamType.ptOutput);

        Params.ParamByName('as_tjdw').AsString := '350802000000';
        Params.ParamByName('as_tjny').AsString := '200703';
        Params.ParamByName('as_tjfwdy').AsString := '350802000000';
        Params.ParamByName('ab_reset').AsInteger := 0;
        Params.ParamByName('as_username').AsString := '210197';
        Params.ParamByName('as_progress').AsString := '0';
        Params.ParamByName('as_progress_info').AsString := '新统计任务。';
        Params.ParamByName('as_parm').AsString := 'oooo';
        Params.ParamByName('as_comment').AsString := '123';

        Execute;

        ai_return := Params.ParamByName('ai_return').AsInteger;
        as_errmsg := Params.ParamByName('as_errmsg').AsString;
      finally
        Free;
      end;
      if ai_return = -1 then
      begin
        jsDialogs.ShowWarning('更新统计任务出错:' + as_errmsg, '统计提示');
        //Rollback(h);
        Exit;
      end;

存儲過程出錯.jpg

16.71 KB, 下载次数: 148

回复

使用道具 举报

发表于 2007-9-11 10:16:51 | 显示全部楼层
您先别用代码创建控件,
直接配置属性,param让控件自动产生,然后再用代码给参数赋值。
看看报什么错误,并看看服务器的命令行有什么错误?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-11 10:43:08 | 显示全部楼层
create or replace procedure sp_bbtj_insert_stat_record
(
  as_tjdw          varchar2, --统计单位
  as_tjny          varchar2, --统计年月
  as_tjfwdy        varchar2, --统计范围定义
  ab_reset         number, --是否清除统计进度,重新统计。
  as_username      varchar2, --统计提交人
  as_progress      varchar2, --统计进度标志
  as_progress_info varchar2, --统计进度说明
  as_parm          varchar2, --统计附加参数
  as_comment       varchar2, --备注
  ai_return        out number, --返回值
  as_errmsg        out varchar2 --错误信息
)

用控件自动产生的
number类型的 为什么在Param里的DataType类型为ftFMTBcd

那我在赋值的时候,要啥赋值?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-11 10:47:52 | 显示全部楼层
还是报一样的错误????
回复 支持 反对

使用道具 举报

发表于 2007-9-11 11:05:45 | 显示全部楼层
贴一下服务器端的错误
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-11 11:38:02 | 显示全部楼层
服务端部署在WAS5。1上,查看/appserver/logs/server1/目录下的error之类的log文件没有扑捉到上面的错误。
回复 支持 反对

使用道具 举报

发表于 2007-9-11 11:43:06 | 显示全部楼层
我拿你那些参数类型测试一下,请稍候
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-11 11:53:40 | 显示全部楼层
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R com.justep.bizservice.methods.BizServerMethodException: [Invoke Method] ExecuteSQL error: The data "null" is not legal for a JDOM attribute: A null is not a legal XML value.
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.methods.TExecuteSQLJMethod.invoke(TExecuteSQLJMethod.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.methods.BiServerMehtodDelegate.invoke(BiServerMehtodDelegate.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.methods.TBatchServerJMethod.invoke(TBatchServerJMethod.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.methods.BiServerMehtodDelegate.invoke(BiServerMehtodDelegate.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.action.InvokeMethodAction.Execute(InvokeMethodAction.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.serverlogic.BaseDataSrvProvider.ExecuteAction(BaseDataSrvProvider.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.serverlogic.BaseDataSrvProvider.InvokeServerMethod(BaseDataSrvProvider.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.statelessejb.StatelessBizServerBean.InvokeServerMethod(StatelessBizServerBean.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.statelessejb.EJSRemoteStatelessStatelessBizServer_58db32ee.InvokeServerMethod(Unknown Source)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.rmi.util.ProxyUtil$4.run(ProxyUtil.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at java.security.AccessController.doPrivileged(Native Method)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at $Proxy3.InvokeServerMethod(Unknown Source)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.statelessejb._StatelessBizServer_Stub.InvokeServerMethod(_StatelessBizServer_Stub.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.BizWebApp.EJBBizStatelessServletHelper.doInvokeServerMethod(EJBBizStatelessServletHelper.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.BizWebApp.BizStatelessServletHelper.InvokeBizMethod(BizStatelessServletHelper.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.BizWebApp.BizServerStatelessServlet.doPost(BizServerStatelessServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R com.justep.bizservice.methods.BizServerMethodException: [Invoke Method] invoke batch method error, [Invoke Method] ExecuteSQL error: The data "null" is not legal for a JDOM attribute: A null is not a legal XML value.
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.methods.TBatchServerJMethod.invoke(TBatchServerJMethod.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.methods.BiServerMehtodDelegate.invoke(BiServerMehtodDelegate.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.action.InvokeMethodAction.Execute(InvokeMethodAction.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.serverlogic.BaseDataSrvProvider.ExecuteAction(BaseDataSrvProvider.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.serverlogic.BaseDataSrvProvider.InvokeServerMethod(BaseDataSrvProvider.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.statelessejb.StatelessBizServerBean.InvokeServerMethod(StatelessBizServerBean.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.statelessejb.EJSRemoteStatelessStatelessBizServer_58db32ee.InvokeServerMethod(Unknown Source)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.rmi.util.ProxyUtil$4.run(ProxyUtil.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at java.security.AccessController.doPrivileged(Native Method)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at $Proxy3.InvokeServerMethod(Unknown Source)
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.bizservice.statelessejb._StatelessBizServer_Stub.InvokeServerMethod(_StatelessBizServer_Stub.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.BizWebApp.EJBBizStatelessServletHelper.doInvokeServerMethod(EJBBizStatelessServletHelper.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.BizWebApp.BizStatelessServletHelper.InvokeBizMethod(BizStatelessServletHelper.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.justep.BizWebApp.BizServerStatelessServlet.doPost(BizServerStatelessServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
[07-9-11 11:25:38:501 CST] 76234397 SystemErr     R         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
回复 支持 反对

使用道具 举报

发表于 2007-9-11 13:38:23 | 显示全部楼层
create or replace procedure TestProc_20070704

(prmin in varchar2
, prmout1 out  number
,prmout2 out  varchar2) is
begin
  prmout1:=1234;
  prmout2:=prmin||'-justep';
end TestProc_20070704;

这个例子曾经测试过,应该跟数据类型没关系。

你的输入参数都是什么?另外你的x3版本是什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-11 13:51:54 | 显示全部楼层
比較老的版本,2401版本
參數的類型就是第一貼的那樣子
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-1-16 03:02 , Processed in 0.044153 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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