Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using TRIM function with outer join 1

Status
Not open for further replies.

hazelsisson

Programmer
Mar 18, 2002
68
0
0
GB
Hi guys,

just a quick question (hopefully).

This is my desired query (simplified):
Code:
select p.dm_id, x.title 
from   post p, post_desc x
where  p.post_num = trim(x.post_no)(+)

But I get the error "ORA-00933: SQL command not properly ended" because of the use of the trim function before the (+).

Is there any way of using the trim function in this scenario, or will I need to pad out the other side of the join instead? The field x.post_no is always 12 characters long and is filled with spaces, whereas p.post_num is already "trimmed".

Many thanks,
Hazel


 
Haven't got time to test it, but try this:

select p.dm_id, x.title
from post p, post_desc x
where p.post_num = trim(x.post_no(+))
 
Brilliant, it worked!

So simple too, why didn't I think of that? [wink]

Thanks very much Dagon.
 
Hazel,

Something "Brilliant (and)...so simple too" deserves a
star.gif
, don't you agree?

You can award a
star.gif
by clicking "Thank Dagon for this valuable post".

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Hi Santa,

I totally agree and usually do give someone a star.

However when I tried to yesterday I found that our network security guys had placed a restriction on it - maybe because it was classed as "voting" for something, I'm not sure. So instead of the usual popup I got a content violation message.

Would it be possible for you to give Dagon a star on my behalf?

Sorry about that - I really do appreciate the help!

Cheers
Hazel
 
Glad to oblige, Hazel.

Dagon, hava
star.gif
from the both of us.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top