!!!用TQuery在InterBase中创建存储过程时奇怪问题!!!(100分)

B

Buder

Unregistered / Unconfirmed
GUEST, unregistred user!
!!!用TQuery在InterBase中创建存储过程时奇怪问题!!!

如下程序段:
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
With Query1 do
begin
DataBaseName:='IBLocal';
ParamCheck:=false;
With SQL do
begin
clear;
Add('Create Procedure Get_Max_Emp_Name1');
Add('Returns(Max_Name char(15))');
Add('As');
Add('Begin');
Add('Select Max(Last_Name)');
Add('From Employee');
Add('Into :Max_Name;');
Add('Suspend;');
Add('End');
end;
ExecSQL;
end
end;
单击按钮,输入密码masterkey,然后出现错误:
Porject Porject1.exe raised exception class EDataBaseError with message
"Query1:Field 'emp_no' is of an unknown type'.
为什么呢?好奇怪的错误呀?
另:我随后用SQL Explorer,打开IBLocal,在SQL选项卡中输入
Create Procedure Get_Max_Emp_Name1
Returns(Max_Name char(15))
As
Begin
Select Max(Last_Name)
From Employee
Into :Max_Name;
Suspend;
End
然后CTRL+E执行却正确地建立了所需地存储过程!
搞了一个小时,头大!!!
高手救命a!
 
可能查询控件的参数有问题,你要设类型
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
449
import
I
D
回复
0
查看
748
DelphiTeacher的专栏
D
顶部