怎样把sql语句执行的结果放到变量里? ( 积分: 20 )

  • 主题发起人 主题发起人 dafuwengqing
  • 开始时间 开始时间
D

dafuwengqing

Unregistered / Unconfirmed
GUEST, unregistred user!
with sql do
begin
cli closecl
add('select flag1 into :f from kch ');
add('where kch=:kc');
end;
parameters.ParamByName('kc').Value :=kch;
parameters.ParamByName('f').Value :=flag;
tishi
 
with sql do
begin
cli closecl
add('select flag1 into :f from kch ');
add('where kch=:kc');
end;
parameters.ParamByName('kc').Value :=kch;
parameters.ParamByName('f').Value :=flag;
tishi
 
s:='select flag1 into %s from kch where kch=:kc";
s:= format(s,[tablename]);
sql.clear;
sql.add(s);
parameters.ParamByName('kc').Value :=kch;
 
我是想在kch表中把kch为kc的flag值放到一个delphi的变量f里面.
f:boolean;
 
你这样操作行不通的,还是用FieldByName('flag1').AsBoolean吧
 
后退
顶部