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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replacing a character in SQL

Status
Not open for further replies.

lasd

Programmer
Jan 14, 2005
48
0
0
IE
Hi

I was hoping someone could help me. I have written some SQL code to extract data from some tables. The data has been extracted but then i want to copy this data to a different file. The problem is that one of the fields(path field) contains some characters that i do not want. for eg. 2D#201!.TIF. i do not want to see the hash here. i want to remove and delete the hash from the original file name when i am copying it over to the new file. Is this possible and do I need an if-then-else statement.... here is the code i wrote to copy over the file

select 'Copy ' || profile.docserver_loc || profile.path || TRIM(components.path)
|| ' ' || TRIM(components.path)

it is on the second TRIM(components.path) that i need to delete the hash in the file name.
thanks a million in advance for the help.
lasd
 
You could try
Code:
select 'Copy ' || profile.docserver_loc || profile.path || TRIM(components.path) 
               || ' ' || [COLOR=red]Replace([/color]TRIM(components.path)[COLOR=red],"#","")[/color]
 
... || REPLACE(TRIM(components.path), '#', '')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top