{"id":1217,"date":"2016-06-08T07:13:33","date_gmt":"2016-06-08T07:13:33","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=1217"},"modified":"2016-06-08T07:13:33","modified_gmt":"2016-06-08T07:13:33","slug":"null-or-blank-fields-check-in-oracle","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/null-or-blank-fields-check-in-oracle\/","title":{"rendered":"NULL or BLANK fields check in Oracle"},"content":{"rendered":"<p>If you want a query which returns rows in column containing NULL or empty space then the using NULL alone in where clause will not return empty space rows. So the query should be altered as below<\/p>\n<p><strong>Actual Query<\/strong><\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\n SELECT COUNT (*) \r\n   FROM TABLE \r\n  WHERE COL_NAME IS NULL;\r\n<\/pre>\n<p><strong>Altered Query<\/strong><\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\n  SELECT COUNT (*) \r\n    FROM TABLE \r\n   WHERE trim(COL_NAME) IS NULL\r\n<\/pre>\n<p>(or)<\/p>\n<p><strong>Altered Query<\/strong><\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\n  SELECT COUNT (*) \r\n    FROM TABLE  \r\n    WHERE COL_NAME IS NULL OR \r\n          LENGTH(TRIM (COL_NAME)) = 0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you want a query which returns rows in column containing NULL or empty space then the using NULL alone in where clause will not return empty space rows. So the query should be altered as below Actual Query SELECT COUNT (*) FROM TABLE WHERE COL_NAME IS NULL; Altered Query SELECT COUNT (*) FROM TABLE&hellip; <a href=\"https:\/\/codethataint.com\/blog\/null-or-blank-fields-check-in-oracle\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-1217","post","type-post","status-publish","format-standard","hentry","category-queries-oracle-database-2"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=1217"}],"version-history":[{"count":1,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1217\/revisions"}],"predecessor-version":[{"id":1218,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1217\/revisions\/1218"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=1217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=1217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=1217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}