• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • sybase存儲過程問題

    發表于:2007-07-14來源:作者:點擊數: 標簽:
    問:SYBASE存儲過程,為什么執行到這一句就不執行了 select@nSerialNo=serialnofromschedulewherephonenum=@strPhoneNumandtype=@nType if@@rowcount=0 begin ... end else begin ... end 上面的select結果是空記錄集,存儲過程一執行到空記錄集,就會返回?
    問: SYBASE存儲過程,為什么執行到這一句就不執行了 
    select @nSerialNo = serialno from schedule where phonenum= @strPhoneNum and type = @nType 
    if @@rowcount = 0 
    begin 
    ... 
    end 
    else 
    begin 
    ... 
    end 
    上面的select結果是空記錄集,存儲過程一執行到空記錄集,就會返回?

    答:if exists(select @nSerialNo = serialno from schedule where phonenum= @strPhoneNum and type = @nType)這個語句的邏輯有點問題? 
    if exists 一般是用來確定是否存在類似的記錄?你現在又要將存在的結果賦值?其實還不如寫 if exists(select 1 from schedule where phonenum= @strPhoneNum and type = @nType) 
    確定是否存在這樣的記錄,在執行相應的處理。   

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>