当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 就是启动时,从 dos 刚要切换到 有滚动条的画面 时,本来显示的是类似“》》》”的东西,而现在这一行变成乱码了,该如何解决?谢谢大家帮忙。 ......
    摘要: visual basic 6.0/2002/2003 visual studil 6.0/2002/2003 sql server 2000 oracle 8i/9i 语言版本均要英文版和中文版的价格 正版的价格,请回复者注明是哪个地方的报价,多谢了 ......


简单存储过程问题,结束立即结帖

CREATE       procedure   search_accident  
                  @zqAddress   varchar,@zqLevel   varchar,@zqType   varchar,@zqTime1   datetime,@zqTime2   datetime  
  as  
  Declare   @strSQL   varchar  
  set   @strSQL   =   select   *   from   BasicInfo   where   Num   >0             //error!!!!!!!!!!!!!!!!!!!!!  
  if   (@zqType!=null)  
  set   @strSQL   =   @strSQL   +   and   灾种   like   +   %+@zqType+%  
  if   (@zqTime1!=null)  
  set   @strSQL   =   @strSQL   +     and   发生时间>+@zqTime1+  
  if   (@zqTime2!=null)  
  set   @strSQL   =   @strSQL   +     and   发生时间<+@zqTime2+  
  if   (@zqLevel!=null)  
  set   @strSQL   =   @strSQL   +   and   事故等级   like   +   %+@zqLevel+%  
  if   (@zqAddress!=null)                                                  
  set   @strSQL   =   @strSQL   +   and   发生地点   like   +   %+@zqAddress+%  
  exec(@strSQL)  
  GO  
   
   
  各位大哥   小弟初学sp,这个存储过程用于查询,为何调试的时候总是停在上面的错误行呢?   另,如果在程序里直接调用它,会返回查询结果吗?   不行该怎么写呢?

NO.1   作者: vivianfdlpw

Declare   @strSQL   varchar(2000)  
  set   @strSQL   =   select   *   from   BasicInfo   where   Num   >0             //error!!!!!!!!!!!!!!!!!!!!!  
  if   (@zqType   is   not   null)  
  set   @strSQL   =   @strSQL   +   and   灾种   like   +   %+@zqType+%  
  if   (@zqTime1   is   not   null)  
  set   @strSQL   =   @strSQL   +     and   发生时间>+@zqTime1+  
  if   (@zqTime2   is   not   null)  
  set   @strSQL   =   @strSQL   +     and   发生时间<+@zqTime2+  
  if   (@zqLevel   is   not   null)  
  set   @strSQL   =   @strSQL   +   and   事故等级   like   +   %+@zqLevel+%  
  if   (@zqAddress   is   not   null)                                                  
  set   @strSQL   =   @strSQL   +   and   发生地点   like   +   %+@zqAddress+%  
  exec(@strSQL)  
 

NO.2   作者: paoluo

CREATE       procedure   search_accident  
                  @zqAddress   varchar(100),@zqLevel   varchar(100),@zqType   varchar(100),@zqTime1   datetime,@zqTime2   datetime  
  as  
  Declare   @strSQL   varchar(1000)  
  set   @strSQL   =   select   *   from   BasicInfo   where   Num   >0   1=1            
  if   (@zqType!=null)  
  set   @strSQL   =   @strSQL   +   and   灾种   like   +   %+@zqType+%  
  if   (@zqTime1!=null)  
  set   @strSQL   =   @strSQL   +     and   发生时间>+@zqTime1+  
  if   (@zqTime2!=null)  
  set   @strSQL   =   @strSQL   +     and   发生时间<+@zqTime2+  
  if   (@zqLevel!=null)  
  set   @strSQL   =   @strSQL   +   and   事故等级   like   +   %+@zqLevel+%  
  if   (@zqAddress!=null)                                                  
  set   @strSQL   =   @strSQL   +   and   发生地点   like   +   %+@zqAddress+%  
  exec(@strSQL)  
  GO

NO.3   作者: paoluo

所有的varchar没有定义长度,会默认为1。  
   
  CREATE       procedure   search_accident  
                  @zqAddress   varchar(100),@zqLevel   varchar(100),@zqType   varchar(100),@zqTime1   datetime,@zqTime2   datetime  
  as  
  Declare   @strSQL   varchar(1000)  
  set   @strSQL   =   select   *   from   BasicInfo   where   Num   >0            
  if   (@zqType!=null)  
  set   @strSQL   =   @strSQL   +   and   灾种   like   +   %+@zqType+%  
  if   (@zqTime1!=null)  
  set   @strSQL   =   @strSQL   +     and   发生时间>+@zqTime1+  
  if   (@zqTime2!=null)  
  set   @strSQL   =   @strSQL   +     and   发生时间<+@zqTime2+  
  if   (@zqLevel!=null)  
  set   @strSQL   =   @strSQL   +   and   事故等级   like   +   %+@zqLevel+%  
  if   (@zqAddress!=null)                                                  
  set   @strSQL   =   @strSQL   +   and   发生地点   like   +   %+@zqAddress+%  
  exec(@strSQL)  
  GO  
 

NO.4   作者: zlp321002

--同意楼上


    摘要: <% dim objword dim objdoc dim objfso dim strsource dim strtarget dim bbatch function getparams() dim objarg if wscript.arguments.count >= 2 then if wscript.arguments.item(0) = "-s"......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE