同上,谢谢!!!

解决方案 »

  1.   

    create proc p_t(@a int,@b int out)
    as
     if (select * from sysobject where id=@a)>0 
        select @b=9
     else 
        select @b=10
    go//delphi
    with adoStoredproc1 do
    begin
      procedureName :='p_t;1';
      parameters.refresh;
      parameters.paramByName('@a').value := 1;
      parameters.paramByName('@b').value := -1;//输出参数也要设值
      open;//如果不返回数据集execProc;
      showmessage(inttostr(parameters.paramByName('@b').value));end
      

  2.   

    放ADO的ADOStoredProc或BDE的StoredProc
      

  3.   

    我只会简单,看看这个明白不!
    建立存储过程我这里用代码写了
       q.Close;
       q.SQL.Clear;
       q.sql.Add('create procedure an ');
       q.SQL.Add('@sn char(20), ');
       q.sql.Add('@cn char(16), ');
       q.sql.Add('@cm char(50) ');
       q.SQL.Add('as ');
       q.sql.Add('insert into bb (name,studno,memo)values(@sn,@cn,@cm)');
       q.ExecSQL;下面是在‘添加’按钮调用
       q.Close;
        q.SQL.Clear;
        q.SQL.Add('exec an');
        q.SQL.Add('@sn=:sn, ');
        q.SQL.Add('@cn=:cn, ');
        q.SQL.Add('@cm =:cm ');
        q.Parameters.ParamByName('sn').Value:=edit1.Text;
        q.Parameters.ParamByName('cn').value:=edit2.Text;
        q.Parameters.ParamByName('cm').Value:=memo1.Text;
        q.ExecSQL;
        q.Close;
        showmessage('添加成功');这只是简单的列子