我需要将两个varchar2列(HOME,AWAY)与参数p_search_string进行比较,但需要使用%外卡。当我发送几封首字母时,我想找到所有列的HOME或AWAY,这三个首字母。
<!DOCTYPE HTML>
<Html>
<!--Header loads CSS page and sets title-->
<head>
<link rel="stylesheet" href="blogStyle.css">
<title>Blog.</title>
</head>
<body>
<!--Page Div acts as container for all page elements-->
<div class="page">
<!--topnav taken from W3Schools and modified-->
<div class="topnav">
<a class="active" href="">Blog.</a>
<a href=""id="login">Login</a>
<!--<a href="#contact">Register</a>
<a href="">Top</a>
<a href="">Recent</a>-->
<input type="text" placeholder="Search" id="searchBar"> <!--added this element to template-->
</div>
<div id="window">
<!--<img style="width:100%;height:400px;object-fit:cover;"src="paul-gilmore-181002-unsplash.jpg">-->
<!--<img style="max-width:15%;max-height:15%;z-index:2;align:center;"src="avatar.jpg" border="2">-->
<img id="banner"src="paul-gilmore-181002-unsplash.jpg">
<img id="avatar"src="spike-avatar.jpg">
<h1>Joe's Blog</h1>
</div>
<div id="blogPosts">
<div class="post">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>2nd January 2012,3:34PM</br>
Random, Productivity, Music</i></h4>
</div>
<div class="post">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>2nd January 2012,3:34PM</br>
Random, Productivity, Music</i></h4>
</div>
<div class="post">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>2nd January 2012,3:34PM</br>
Random, Productivity, Music</i></h4>
</div>
<div class="post">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>2nd January 2012,3:34PM</br>
Random, Productivity, Music</i></h4>
</div>
<div class="post">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>2nd January 2012,3:34PM</br>
Random, Productivity, Music</i></h4>
</div>
<div class="post">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>2nd January 2012,3:34PM</br>
Random, Productivity, Music</i></h4>
</div>
</div>
<div id="SidePosts">
<h1><a href="">Recent</a></h1>
<div class="post2">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>User: John</i></h4>
</div>
<div class="post2">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>User: John</i></h4>
</div>
<h1><a href="">Popular</a></h1>
<div class="post2">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>User: John</i></h4>
</div>
<div class="post2">
<h3>Post Title</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices blandit erat sed fermentum. Sed scelerisque lacus et condimentum congue.Morbi eu purus id mauris lobortis bibendum. Praesent nec placerat mi. Maecenas sodales fermentum turpis a vehicula. tincidunt aliquam just.</h4>
<h5><i>User: John</i></h4>
</div>
</div>
</div>
<!--Each a link in pageNav would link to previous page of blog, first page, last page and next page-->
<div class="pageNav">
<a href=""><</a>
<a href="">1</a>
<p>...</p>
<a href="">25</a>
<a href="">></a>
</div>
</body>
</html>
我尝试了几种方法,但是我遇到了期待的错误,或者类似的错误......
答案 0 :(得分:2)
您需要使用upper('%' || p_search_string || '%')