{"id":6567,"date":"2020-06-03T14:06:24","date_gmt":"2020-06-03T19:06:24","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=6567"},"modified":"2020-06-03T14:06:24","modified_gmt":"2020-06-03T19:06:24","slug":"oracle-adding-fixed-string-to-column-data","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=6567","title":{"rendered":"Oracle &#8211; Adding Fixed String To Column Data"},"content":{"rendered":"<p>I had a request to drop data from a SQL query into an Excel spreadsheet &#8212; the initial request had a column that included different text depending on row data. Since Box::Spout deals well with huge volumes of data (I write millions of rows in some reports), I use it pretty exclusively. Writing data to each column individually means I&#8217;ve got to retain a list of column names, and I would rather not do that. I can dump the column names into a header row then dump the entire database row into the next spreadsheet row. This works since a 1:1 correlation between database rows and Excel rows. I&#8217;ll go through after the fact and update a specific cell based on data in other cells, but I don&#8217;t want to <em>insert<\/em> a column.<\/p>\n<p>Luckily, there&#8217;s an easy way to add a placeholder column to my database output:<\/p>\n<p>SELECT DISTINCT MAX(DLR1.ISSUE_NBR) MAX_ISSUE_NBR, DLR.ISSUE_NBR, <strong>&#8216;MatchIndicator&#8217; as &#8220;MatchIndicator&#8221;<\/strong>, DLR.EQUIPMENT_ID, EQ.EQUIPMENT_ID, C.CIRCUIT_DESIGN_ID, C.EXCHANGE_CARRIER_CIRCUIT_ID, C.STATUS, C.RATE_CODE, C.SERVICE_TYPE_CATEGORY, C.SERVICE_TYPE_CODE, NL.LOCATION_ID, NL.CLLI_CODE, DLR.LOCATION, DLR.BLOCK_IND<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a request to drop data from a SQL query into an Excel spreadsheet &#8212; the initial request had a column that included different text depending on row data. Since Box::Spout deals well with huge volumes of data (I write millions of rows in some reports), I use it pretty exclusively. Writing data to &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1003,1004],"tags":[889,890,888,595],"class_list":["post-6567","post","type-post","status-publish","format-standard","hentry","category-database","category-oracle","tag-metasolv","tag-metasolv-solutions","tag-mss","tag-oracle"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6567"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6567\/revisions"}],"predecessor-version":[{"id":6568,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6567\/revisions\/6568"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}