<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CLOB &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/clob/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Fri, 21 Apr 2023 06:07:29 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>CLOB &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>資料庫問題彙整</title>
		<link>https://noter.tw/8540/database/</link>
					<comments>https://noter.tw/8540/database/#comments</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Fri, 04 Jun 2021 02:29:26 +0000</pubDate>
				<category><![CDATA[資料庫]]></category>
		<category><![CDATA[java.sql.SQLException]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[ORA-00932]]></category>
		<category><![CDATA[inconsistent datatypes]]></category>
		<category><![CDATA[CLOB]]></category>
		<category><![CDATA[to_char]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=8540</guid>

					<description><![CDATA[<p>記錄一些遇到過 DB 相關錯誤訊息。 這些問題都是消耗時間換來的經驗，希望能節省有相同問題的您的時間，現在開始陸續補上 (但也可能偷懶後來就沒更新了 Orz &#8230;) java.sql.SQL&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/8540/database/" data-wpel-link="internal">資料庫問題彙整</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>記錄一些遇到過 DB 相關錯誤訊息。</p>



<span id="more-8540"></span>



<p>這些問題都是消耗時間換來的經驗，希望能節省有相同問題的您的時間，現在開始陸續補上 (但也可能偷懶後來就沒更新了 Orz &#8230;)</p>



<h2 class="para wp-block-heading">java.sql.SQLException: ORA-00932: inconsistent datatypes: expected &#8211; got CLOB</h2>



<p>小蛙收到問題回報，在某個頁面的排序功能上會出現該錯誤，這個問題的解法很簡單，只是用來排序的欄位上出現 CLOB 格式，只要使用 to_char() 把 CLOB 轉成 CHAR 來做排序即可。例如：</p>



<p class="pre left green font-code">// 原始 SQL<br>SELECT * FROM EXHIBITION ORDER BY clob_field DESC<br>// 改成<br>SELECT * FROM EXHIBITION ORDER BY <span class="has-inline-color has-vivid-red-color"><strong>to_char(</strong></span>clob_field<strong><span class="has-inline-color has-vivid-red-color">)</span></strong> DESC</p>



<p>參考資料：<a href="https://blog.xuite.net/akf3dsmax8/wretch/192494934-oracle+sql+distinct+clob" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">來源1<span class="wpel-icon wpel-image wpel-icon-6"></span></a>、<a href="https://stackoverflow.com/questions/12980038/ora-00932-inconsistent-datatypes-expected-got-clob" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">來源2<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/8540/database/" data-wpel-link="internal">資料庫問題彙整</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/8540/database/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
