Hello Sridhar, Have you tried the 'coalesce' function to handle the nulls?Kind Regards,Adam PearsonFrom: pgsql-general-owner@postgresql.org <pgsql-general-owner@postgresql.org> on behalf of Sridhar N Bamandlapally <sridhar.bn1@gmail.com>Sent: 12 May 2016 09:47To: PG-General Mailing List; PostgreSQL-hackersSubject: [GENERAL] NULL concatenation Hi In migration, am facing issue with NULL concatenation in plpgsql, by concatenating NULL between any where/position to Text / Varchar, the total string result is setting value to NULLIn Oracle:declare txt1 VARCHAR2(100) := 'ABCD'; txt2 VARCHAR2(100) := NULL; txt3 VARCHAR2(100) := 'EFGH'; txt VARCHAR2(100) := NULL;begin txt:= txt1 || txt2 || txt3; dbms_output.put_line (txt);end;/abcdefgh ===>return valueIn Postgresdo $$declare txt1 text := 'ABCD'; txt2 text := NULL; txt3 text := 'EFGH'; txt text := NULL;begin txt:= txt1 || txt2 || txt3; raise notice '%', txt;end$$ language plpgsql;NOTICE: <NULL> ===> return valueSQL-Server also does same like OracleIs there any way alternate we have for same behavior in PostgreSQLPleaseThanksSridharOpenText
Hello Sridhar,
Have you tried the 'coalesce' function to handle the nulls?
Kind Regards,
Adam Pearson
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных