{"id":331,"date":"2012-10-09T21:21:13","date_gmt":"2012-10-09T21:21:13","guid":{"rendered":"http:\/\/62.131.51.129\/wordpress\/?p=331"},"modified":"2012-10-09T21:21:13","modified_gmt":"2012-10-09T21:21:13","slug":"how-many-non-nulls-per-column","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=331","title":{"rendered":"How many non-nulls per column?"},"content":{"rendered":"<p>In Oracle, it is quite well possible to display quickly how many non-nulls we have per column in a table.<br \/>\nThe script reads like:<\/p>\n<pre>set termout off echo on feed off trimspool \non head off pages 0\n\nspool C:\\countall.tmp\n\nSELECT  'select count('||t.column_name||') \n from ' || t.table_name ||';'\nFROM    user_tab_columns t\nWHERE  t.table_name = 'DATE_D2'\n;\n\nspool off\n\nset termout on\n@@c:\\countall.tmp\n\nset head on feed on<\/pre>\n<p>And the results look like:<\/p>\n<p><a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2012\/10\/Oracle12.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2012\/10\/Oracle12.jpg\" alt=\"\" title=\"Oracle1\" width=\"677\" height=\"342\" class=\"alignnone size-full wp-image-341\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Oracle, it is quite well possible to display quickly how many non-nulls we have per column in a table. The script reads like: set termout off echo on feed off trimspool on head off pages 0 spool C:\\countall.tmp SELECT &#8216;select count(&#8216;||t.column_name||&#8217;) from &#8216; || t.table_name ||&#8217;;&#8217; FROM user_tab_columns t WHERE t.table_name = &#8216;DATE_D2&#8217; ; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-331","post","type-post","status-publish","format-standard","hentry","category-nice-to-know"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=331"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/331\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}