起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 1138|回复: 37

【结贴】调用存储过程出错**

[复制链接]
发表于 2008-5-16 11:15:19 | 显示全部楼层 |阅读模式
在X3系统 新建一个资源集 调用oracle 存储过程。

内容如下下图,在调用该过程是报错(附图)。
请问是什么问题,以前在2076 版本中是正常的

另外 如何在X3中取到当前操作的机构及姓名。
以前是:as_recman:=lContextCurrent.Operator.Person.DisplayName;
谢谢!

1.jpg

16.44 KB, 下载次数: 286

回复

使用道具 举报

 楼主| 发表于 2008-5-16 11:16:36 | 显示全部楼层

Re: 调用存储过程出错

资源集代码

2.jpg

148.5 KB, 下载次数: 279

回复 支持 反对

使用道具 举报

发表于 2008-5-16 11:26:48 | 显示全部楼层
用"X3服务器端配置工具"检查一下服务器端的数据源及数据库的配置,是否有当前数据库的连接
回复 支持 反对

使用道具 举报

发表于 2008-5-16 11:30:28 | 显示全部楼层
1.引用"业务模型\系统空间\系统运行库\系统核心库"
2.调用:SystemCore.TSystemCore.Operator.DisplayName;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-16 11:53:33 | 显示全部楼层
最初由 gaihl 发布
[B]用"X3服务器端配置工具"检查一下服务器端的数据源及数据库的配置,是否有当前数据库的连接 [/B]


取操作人的搞定了。

用"X3服务器端配置工具"检查一下服务器端的数据源及数据库的配置,是否有当前数据库的连接
这个连接也没有问题。

在调用过程的时候报这个错误(附图)

3.jpg

108.98 KB, 下载次数: 266

回复 支持 反对

使用道具 举报

发表于 2008-5-16 13:28:46 | 显示全部楼层
参考一下这个贴子:
http://bbs.justep.com/forum.php?mod=viewthread&tid=16296

也可以搜索"无效的列索引", 会能更多参考贴子
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-16 14:27:07 | 显示全部楼层
看了刚刚这个帖子,把相应的名称也都改成了大写,还是一样的报错信息。
有可能是资源集中调用存储过程时还要引用什么其他东东不 ?还请告知,谢谢!
回复 支持 反对

使用道具 举报

发表于 2008-5-16 16:11:20 | 显示全部楼层
1.还报一楼的错误了吗??
2.如果不报了,请检查一下存储过程所在的位置,及参数,是否与代码中对应,可能是参数这出了问题
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-16 17:38:51 | 显示全部楼层
我都检查了没有发现什么问题。我把代码贴出来你看看了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-16 17:39:50 | 显示全部楼层
unit CCGCZYJ;

interface

uses
  //Business.System, Business.Model;
  Business.System, Business.Model, Business.Data, Business.Forms;

type
  TCCGCZYJ = class(TBizLibrary)
  private
    {private declarations}
  public
    {public declarations}
  static function create_blankchk(as_chktype: string;ai_beginno: string;ai_chknum: string;as_recman: string; as_errormsg:string;Owner: TForm):string;overload; //生成空白发票

  end;

implementation

static function TCCGCZYJ.CREATE_BLANKCHK(as_chktype: string;ai_beginno: string;ai_chknum: string;as_recman: string; as_errormsg:string;Owner: TForm):string;//生成空白发票
var
  lDataParam1,lDataParam2,lDataParam3,lDataParam4,lDataParam5: TDataParam;//存储过程参数
  Storedproc1:TStoredProc;
  ErrorMsg : string;
begin
  //StoredProc1 := TStoredProc.Create(Owner);
  StoredProc1 := TStoredProc.Create(Owner);
  with StoredProc1 do
   try
    StoredProc1.ConnectionString := 'DATABASEURL=Biz:\OAXT\OACCGCBSJK.Database';
    //StoredProc1.ConnectionString := 'DATABASEURL= Biz:\SYSTEM\SYSTEM.DATABASE';
    StoredProc1.StoredProcName := 'OA_DATA_ACTION.CREATE_BLANKCHK';
    StoredProc1.Params.Clear;
    lDataParam1 := StoredProc1.Params.CreateParam(TFieldType.ftString,  '@as_chktype',TParamType.ptInput);
    lDataParam2 := StoredProc1.Params.CreateParam(TFieldType.ftString,  '@ai_beginno',TParamType.ptInput);
    lDataParam3 := StoredProc1.Params.CreateParam(TFieldType.ftString,  '@ai_chknum',TParamType.ptInput);
    lDataParam4 := StoredProc1.Params.CreateParam(TFieldType.ftString,  '@as_recman',TParamType.ptInput);
    lDataParam5 := StoredProc1.Params.CreateParam(TFieldType.ftString,  '@as_errormsg',TParamType.ptOutput);
    lDataParam1.AsString  := as_chktype;
    lDataParam2.AsString  := ai_beginno;
    lDataParam3.AsString  := ai_chknum;
    lDataParam4.AsString  := as_recman;
    lDataParam5.AsString := '';
    Execute; //这里通不过报5楼的错误
   ErrorMsg := StoredProc1.Params.ParamByName('@as_errormsg').AsString;
  finally
    StoredProc1.Free;
  end;
  Result := ErrorMsg;
end;
end.
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-13 07:16 , Processed in 0.047270 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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