CREATE PROCEDURE depot_out_chbj( @rq datetime, @bppf varchar(48), @jcdy int) AS declare @id int select @id=(select max(id)+1 from depot_out) insert into fhbj(日期,部品品番,结存带用,发货ID) values(@rq,@bppf,@jcdy,@id) GO
回楼上,不行呀. 我发现用 with adoquery1 do begin close; sql.clear; sql.add('select max(id) as id from depot_out') open; end; 用showmessage(inttostr(adoquery1.fieldbyname('id').value)),报错,为空值. 其中ID字段为了标识=是,是不是这个原因呀.
@rq datetime,
@bppf varchar(48),
@jcdy int)
AS
declare
@id int
select @id=(select max(id)+1 from depot_out)
insert into fhbj(日期,部品品番,结存带用,发货ID) values(@rq,@bppf,@jcdy,@id)
GO
我发现用
with adoquery1 do
begin
close;
sql.clear;
sql.add('select max(id) as id from depot_out')
open;
end;
用showmessage(inttostr(adoquery1.fieldbyname('id').value)),报错,为空值.
其中ID字段为了标识=是,是不是这个原因呀.