Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

append static values to column only if value is not null in oracle sql

2844987Dec 29 2015 — edited Dec 30 2015

Hi

I have table in oracle database with below records.

LoginIDFirstNameDNManager DN
USER100Useruid=user100,dc=company,dc=comuid=user101,dc=company,dc=com
User102userx(null)(null)

I am looking for query which can give the output enclosed with double quotes for columns DN and Manager DN. I have written the query which works as long as DN and Manager DN columns are not null. But there are situations where these 2 columns can be null. I don't want to put double quotes when DN or ManagerDN is null. Can someone help me with the query

select loginid, firstname,

'"'||dn||'"',

'"'||manager_dn||'"',

from user

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2016
Added on Dec 29 2015
7 comments
2,090 views