stockdetails.qty =cast((@temp + @temp1) as char(10))   stockdetails.qty是什么意思!!!??

解决方案 »

  1.   

    不是,我问stockdetails代表什么
    .qty 代表什么
      

  2.   

    stockdetails 库存明细表
    qty是表中的一个字段 是库存啊
      

  3.   

    存储过程体中的set @temp1=stockdetails.qty
    可以运行的吗?
    指定的是表stockdetails中的哪一条记录?
      

  4.   

    不能那样写的!!
    alter proc intostock 
    @status int, 
    @num int , --用于接收每种入库商品的变量
    @temp int,--用于接收临时存储总数的变量
    @temp1 int
    as
    set @status=0 --0表示还未通过审核
    set @temp1 int
    set @temp=@temp+@numif @temp<>0 
    begin
    if @status=0
       begin
       print '你的这次输入还未通过审核'
       set @status=1
       end
    else
       begin
       set @temp1=cast(cast((@temp + @temp1) as char(10)) as numeric)
    --顺便问问高手,我的stockdetails.qty 设置的是char类型,如何转成整型啊?谢谢!
       end
    end
    else 
    print '请输入下一个入库商品'
      

  5.   

    set @temp1=stockdetails.qty
    改为:select @temp1=qty from stockdetails where 条件。
    stockdetails.qty =cast((@temp + @temp1) as char(10))改为:set @temp1=cast(cast((@temp + @temp1) as char(10)) as numeric)
    update stockdetails set qty=@temp1 where 条件。-----更新数据库
      

  6.   

    再次感谢你
    谢谢 hsj20041004(光芒)
      

  7.   

    我想知道一下
    为什么
    stockdetails.qty =@temp + @temp1
    会提示有语法错误
    如果要正确的写该如何写
      

  8.   

    stockdetails.qty--就没有表名.字段的写法正确的写:
    改为:set @temp1=cast(cast((@temp + @temp1) as char(10)) as numeric)
    update stockdetails set qty=@temp1 where 条件。-----更新数据库