Last active
May 5, 2016 14:40
-
-
Save alexanderjsingleton/a07c965dc00706e3a6da6311f8ade6ce to your computer and use it in GitHub Desktop.
How to avoid whitespace with RegEx when concatenating multiple-columns in Oracle PL/SQL (REGEXP_REPLACE)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONNECT ap/ap; | |
SET SERVEROUTPUT ON | |
declare | |
min_invoice_total ap.invoices.invoice_total%TYPE; | |
max_invoice_total ap.invoices.invoice_total%TYPE; | |
begin | |
SELECT MIN(invoice_total), MAX(invoice_total) INTO min_invoice_total,max_invoice_total | |
FROM ap.invoices; | |
DBMS_OUTPUT.put_line(REGEXP_REPLACE('The minimum invoice total is' || to_char(min_invoice_total, '$999,999.00') || ' while the maximum output total is ' || to_char(max_invoice_total, '$999,999.00') || '.', ' +', ' ')); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More information available at StackOverflow: Spaces when concatenating multiple columns and one column is null - Oracle.