zoukankan      html  css  js  c++  java
  • 产品位置,设有可选配件(同组如电源系列必选一项的),如果用户没有选择,则发出错误提示。

    USE [erpdb1]
    GO
    /****** Object:  StoredProcedure [dbo].[sp_checkdingdan]    Script Date: 12/29/2014 15:38:30 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[sp_checkdingdan] @docid varchar(30),@ertext varchar(100) output
    AS
    DECLARE  @input_id varchar(20)
    DECLARE  @row_count int
    BEGIN 
        DECLARE cur_input CURSOR  FOR
       select inputid from cpmb_detail where biaodanid = (select chanpinmingchen from dingdanzhu where biaodanid= @docid) and xz='t'
       group by inputid order by inputid  
     set @input_id =0 
     set @row_count = 0 
     --/*
     set @ertext ='y' 
     OPEN cur_input
     
        FETCH  cur_input INTO @input_id
     WHILE @@FETCH_STATUS = 0
          BEGIN
             set @row_count = 0
             SELECT @row_count = count(*) from dingdanfu d,dingdanzhu a where  a.biaodanid  =@docid AND  a.biaodanid = d.biaodanid
        and xuhao in (select xuhao from cpmb_detail where inputid =@input_id and a.chanpinmingchen= cpmb_detail.biaodanid);
             if @row_count = 0
             BEGIN        
                set @ertext ='生产单录入无效,产品位置为:' +@input_id+ '的物料必须选择一项,请重新录入!'
                delete dingdanzhu where biaodanid = @docid;
                CLOSE cur_input
                   DEALLOCATE cur_input
                return
             END  
       FETCH  cur_input INTO @input_id
          END
        CLOSE cur_input
        DEALLOCATE cur_input 
        --*/
    END

  • 相关阅读:
    Linux命令——find
    Linux命令——locate
    python模块:datetime
    python模块:json
    python模块:shelve
    python模块:shutil
    python模块:sys
    python:OS模块
    str.index()与str.find()比较
    python模块:re
  • 原文地址:https://www.cnblogs.com/szlixin/p/4191801.html
Copyright © 2011-2022 走看看