大家真快!谢谢! 语句如下: declare @id char(20) select @id=id from product where (name=:name)and(spe=:spe) go declare @price decimal(32,2) select @price=price from product where id=@id go declare @rental decimal(32,2) declare @num int set @num=:num set @rental=@price*@num/12 go insert into table1 values(@id,@unm,@rental) 大致就是这样的! 我用具体的值在sql下用过,好使的!
贴出你在ADOQUERY写的语句看看!!
大家真快!谢谢!
语句如下:
declare @id char(20)
select @id=id
from product
where (name=:name)and(spe=:spe)
go
declare @price decimal(32,2)
select @price=price
from product
where id=@id
go
declare @rental decimal(32,2)
declare @num int
set @num=:num
set @rental=@price*@num/12
go
insert into table1 values(@id,@unm,@rental)
大致就是这样的!
我用具体的值在sql下用过,好使的!
adoquery1.SQL.Clear ;
adoquery1.SQL.Add('select * from t_item where fitemclassid=:itt');
adoquery1.Parameters[0].Value :=strtoint(edit1.Text );
adoquery1.Open ;
以后就不用说了吧