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

Extract comma (,) out of filed 1

Status
Not open for further replies.

heydyrtt

Programmer
Dec 12, 2001
63
US
I have a table that we will be exporting into a comma delimited file. The problem I've ran into is on column lastname, some of the lastname are like Smith, Jr. This comma is causing problems once exported to csv. Any one know away to get that out, other than record by record.


Thanks



Heydyrtt
 
Heydyrtt,

There are multiple methods of resolving your problem:
1) Enclose columns in double quotes that are susceptible to embedded commas
2) Update all comma-susceptible columns with values resulting from the REPLACE function (sample REPLACE example):
Code:
select replace('123,456,789',',',null) from dual;

123456789
...or REPLACE the commas with some other character such as a semi-colon:
Code:
select replace('123,456,789',',',';') from dual;

123;456;789

Let us know if any of these solutions are acceptible to you.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 17:20 (19Nov04) UTC (aka "GMT" and "Zulu"),
@ 10:20 (19Nov04) Mountain Time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top