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

x
?
Solved

Oracle concatenation

Posted on 2011-05-11
5
Medium Priority
?
308 Views
Last Modified: 2012-05-11
In the following example when title is NULL, it leaves a space extra before the name !.

How do i solve this

TITLE.DESCRIPTION || ' ' || ELECTMEMBER.NAME AS NAME,
0
Comment
Question by:GRChandrashekar
  • 3
5 Comments
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35736360
- yes it leave extra space because you have space in here:  || ' ' ||
- delete the space in between ' ' will correct it:

TITLE.DESCRIPTION || '' || ELECTMEMBER.NAME AS NAME,

Open in new window

0
 

Author Comment

by:GRChandrashekar
ID: 35736363
No I need that space when title is not null
0
 
LVL 12

Accepted Solution

by:
enachemc earned 2000 total points
ID: 35736374
select
case
when TITLE.DESCRIPTION is not null then TITLE.DESCRIPTION || ' '
else ''
end || ELECTMEMBER.NAME as name
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35736376
- use trim()

TRIM(TITLE.DESCRIPTION || '' || ELECTMEMBER.NAME AS NAME),

Open in new window

0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35736381
- i didn't change the ||''|| code above to have space in between. you should correct that in your code :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question