⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 259.html

📁 关于jsp的一些好文章 主要介绍一些关于JSP的应用技巧方面的东西
💻 HTML
字号:

<STYLE type=text/css>
<!--
body,td { font-size:9pt;}
hr { color: #000000; height: 1px}
-->
</STYLE>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD><TITLE>精选文章 >> Oracle 专栏 >> 在Oracle快速进行数据行存在性检查</title>
</head>
<body >

<p><IMG SRC="../image/jsp001_middle_logo.gif" WIDTH="180" HEIGHT="60" BORDER=0 ALT=""></p>

<table width=100% bgcolor="#cccccc" align=center cellpadding="2" cellspacing="0" border=1 bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr bgcolor="#EFF8FF"><td>
<a href=http://www.jsp001.com/list_thread.php?int_attribute=2>精选文章</a>
>> <a href=http://www.jsp001.com/list_thread.php?forumid=20&int_attribute=2>Oracle 专栏</a>
>> 在Oracle快速进行数据行存在性检查 [<a href=http://www.jsp001.com/forum/showthread.php?goto=newpost&threadid=259>查看别人的评论</a>]<br>

<hr><p>由 webmaster 发布于: 2001-02-05 11:38</p><p><img src="images/icons/icon3.gif" alt="Lightbulb" border=0> </p><p><br><br> <br><br>当在应用程序的业务逻辑中需要检查一个外键是否有相关的主键时,往往使用Select Count(*)类型的SQL语句。这是一个很显而易的方法,但却不是最快的方法。Count(*)函数调用可能会引起对整个表的进行扫描,这是一件很费时的操作。一个更好的方法是使用Oracle提供的称为ROWNUM的新特性,使用这个特性可以使数据库只检索一个启示就可以判断主键是否能与外键相配,这比Count(*)方法快得多,例如: <br><br>SQL Using Count(*) <br><br>    SELECT Count(*) INTO :ll_Count<br>       FROM ORDER<br>       WHERE PROD_ID = :ls_CheckProd<br>       USING SQLCA;<br>    <br>    IF ll_Count &gt; 0 THEN // Cannot delete product <br>SQL Using ROWNUM<br><br>   SELECT ORDER_ID INTO :ll_OrderID<br>       FROM ORDER<br>       WHERE PROD_ID = :ls_CheckProd<br>          AND ROWNUM &lt; 2<br>       USING SQLCA;<br><br>    IF SQLCA.SQLNRows &lt;&gt; 0 THEN // cannot delete product<br></p></td>
  </tr>
</table>

<p>
<CENTER><a href="http://www.jsp001.com/forum/newreply.php?action=newreply&threadid=259">点这里对该文章发表评论</a></CENTER>
<p>该文章总得分是 <font color=red>0</font> 分,你认为它对你有帮助吗?
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=259&intVote=4","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>非常多</a>](<font color=red>0</font>) 
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=259&intVote=2","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>有一些</a>](<font color=red>0</font>) 
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=259&intVote=1","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>无帮助</a>](<font color=red>0</font>) 
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=259&intVote=-1","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>是灌水</a>](<font color=red>0</font>) </p>
<script language="javascript" src="http://www.jsp001.com/include/read_thread_script.php?threadid=259"></script>
<p><CENTER>
Copyright &copy; 2001 - 2009 JSP001.com . All Rights Reserved <P>

<IMG SRC="../image/jsp001_small_logo.gif" WIDTH="85" HEIGHT="30" BORDER=0 ALT="">
</CENTER></p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -