各位同行,怎样动态创建一个Tstoredproc ,用完后在free.
以下是我的源代码:
delphi:
   p_get_priceout:=Tstoredproc.Create(dm);
   p_get_priceout.Databasename:='db_csgl';
   p_get_priceout.StoredProcName:='p_getprice;1';
   p_get_priceout.ParamByName('@bar_code').AsString:=barcode;
   p_get_priceout.execproc;//出错,没有找到参数@bar_code
   price_out:=p_get_priceout.ParamByName('@price_out').AsCurrency;
   result:=price_out;
存储过程源代码:
   create procedure p_getprice--得到某货品的出售价格
    @bar_code  varchar(20),
    @price_out money output
   as
   begin
     set @price_out=(select cur_price from goods 
                      where bar_code=@bar_code)
   end