存储过程,在查询分析器中没有问题,但是在DELPHI中调用参数却不能通过 ( 积分: 50 )

  • 主题发起人 ppqingyu
  • 开始时间
P

ppqingyu

Unregistered / Unconfirmed
GUEST, unregistred user!
这是在存储过程中的定义:
InsertFirstCase(@Case varchar(100),@Case_transact varchar(2500),@Insure varchar(250),
@BranchBewrite varchar(4000),@Involved_personnel varchar(8000),@CaseID InT OUTPUT )
在查询分析器中没有问题:
declare @Case varchar(100),@case_transact varchar(2500),
@Insure varchar(250),@BranchBewrite varchar(4000),@Involved_personnel varchar(8000)
SELECT @Case ='{CFC72D81-FF86-406B-9807-E163E56A0412}|440922640706003|1|AFAD00|0|',
@case_transact = '1|案号|经办人|茂名市中级人民法院|陈海|一审阶段|2006-07-01|2007-03-01|案由|1|1|1|',
@Insure = 'AFAGAA04DFA2006B000001|AFAGAA04DFA2006C000001|400|400|400|2006-01-01|车牌号码|被保险人|',
@branchBewrite = '案件主要描述|机构诉讼意见|',
@Involved_personnel = '(1)原告|在有人要||||(2)被告|英雄模范||||'
DECLARE @CaseID INT
EXEC InsertFirstCase @Case,@Case_transact,@Insure,@BranchBewrite,@Involved_personnel,@CaseID
在程序中不能够通过,出现下面的错误,这是DELPHI中的代码:
try
DM.cdsInsertFirstCase.Close;
DM.cdsInsertFirstCase.FetchParams;
DM.cdsInsertFirstCase.Params.ParamByName('@Case').AsString := FCase;
DM.cdsInsertFirstCase.Params.ParamByName('@Case_transact').AsString := FCase_transact;
DM.cdsInsertFirstCase.Params.ParamByName('@Insure').AsString := FInsure;
DM.cdsInsertFirstCase.Params.ParamByName('@BranchBewrite').AsString := FBranchBewrite;
DM.cdsInsertFirstCase.Params.ParamByName('@Involved_personnel').AsString := FInvolved_personnel;
DM.cdsInsertFirstCase.Params.ParamByName('@CaseID').AsInteger := CaseID;
DM.cdsInsertFirstCase.Execute;
strCaseID := DM.cdsInsertFirstCase.Params.ParamByName('@CaseID').AsString;
ShowMessage('提交成功,当年案件编号:' + strCaseID);
except
ShowMessage('提交失败');
end;
在DELPHI调用参数,出现这个错误:First chance exception at $7C812A5B. Exception class EOleException with message '不允许从数据类型 ntext 到 varchar 的隐性转换。请使用 CONVERT 函数来运行此查询。'. Process LawManage.exe (224)
这会是什么问题?
 
指针类型基本上没办法判断的。建议TreeView的Data设置为对象,这样,就可以很容易的
使用 if TObject(Data) is TSomeClass then
... 来判断。
 
用class代替record指针。
指针没类型可言,但是class有。
 
对, 建议用对象,这样更OO
------------------------------------------------------
http://www.waibaoinfo.com 外包信息网
 
详细一点啦,我都不明白
 
不明白没办法了。昨天我在群里面也回答了你,和creation-zy兄的回答一样!
 
指针么都是Longint型的。
 
指针没有办法判断类型的
上面说了,设计成CLASS就OK了
 
既然你自己的 record 里有 TypeId,用这个判断就可以啦,也不见得非要这么 OO 的嘛
 
顶部