存储过程
sp_outdata(@userid char(10))
select * form table where ID=@userid客户端程序
用TstoredProc 或Tquery
query1:Tquery
procedure getdata(userID:string);
var str_sql:stirng;
begin
str_sql:='sp_outdata '+userid
query1.close;
query1.sql.clear;
query1.sql.add(str_sql);
query1.ExecSQL;
end;
sp_outdata(@userid char(10))
select * form table where ID=@userid客户端程序
用TstoredProc 或Tquery
query1:Tquery
procedure getdata(userID:string);
var str_sql:stirng;
begin
str_sql:='sp_outdata '+userid
query1.close;
query1.sql.clear;
query1.sql.add(str_sql);
query1.ExecSQL;
end;
CREATE PROC pGetID @userid char(10)
AS
SELECT * FROM table WHERE ID = @userid客户端
在adosp的parameters属性中建立一个@userid的参数,设置好datatype和direction
程序如下
adosp.Close;
adosp.Parameters.ParamByName('@userid').Value := userid;
adosp.Prepared;//要不要都可以
adosp.Open;
create proc dbo.dt_whocheckedout
@userId int,
as
sql_statementselect * from tabeltmp where id = userId