[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

concatenate

    MEMBERADDRESS.PHONENUMBER1
       || ','
       || MEMBERADDRESS.PHONENUMBER2
       || ','
       || MEMBERADDRESS.PHONENUMBER3
       || ','
       || MEMBERADDRESS.PHONENUMBER4
          AS PH,

In this, if values are null the output comes as ,,,, or in between is any is null it comes like 1,,2

any way i can sort out this problem
0
GRChandrashekar
Asked:
GRChandrashekar
  • 2
1 Solution
 
slightwv (䄆 Netminder) Commented:
Try:

MEMBERADDRESS.PHONENUMBER1
       || case when MEMBERADDRESS.PHONENUMBER1 is not null then ',' end
...
0
 
slightwv (䄆 Netminder) Commented:
That, or just replace multiple ',,,' with one.

replace(replace(replace(new_str,',,,,',','),',,,',','), ',,','')
0
 
sdstuberCommented:
MEMBERADDRESS.PHONENUMBER1      
       || NVL2(MEMBERADDRESS.PHONENUMBER2,',' || MEMBERADDRESS.PHONENUMBER2,null)
       ||  NVL2(MEMBERADDRESS.PHONENUMBER3,',' || MEMBERADDRESS.PHONENUMBER3,null)
       ||  NVL2(MEMBERADDRESS.PHONENUMBER4,',' || MEMBERADDRESS.PHONENUMBER4,null)
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now