Hi,
>> remove the \n from my table rows
If you know C or C++, the '\n' is the carriage return character. SQL*PLus read this, and inserts a carriage return.
The "\n" is equivalent to chr(10), and you can insert this into a Oracle string:
select
col1||chr(10)||col2
from mytab;
In your case, you need to update your rows to remove the carriage returns. . . .
I would use regexp_replace to remove the |\n" from the rows:
http://dba-oracle.com/googlesearchsite_pro...=regecp_replaceREGEXP_REPLACE
Syntax: regexp_replace( source, pattern, replace string, position, occurrence, options)
The source can be a string literal, variable, or column. The pattern is the expression to be replaced. The replace string is the text that will replace the matching patterns. The optional position defines the location to begin searching the source string. This defaults to 1. The optional occurrence defines the occurrence of the pattern that you want replaced. This defaults to 0 (all occurrences). Setting this to a positive number will result in only that occurrence being replaced. The matching options are the same.
Something like this;
CODE
set escape '\'
create table
mytab1
as
select mycol = regexp_replace(my_column, '\n', '')
from mytab;
I have not tested this; you may need to "escape" the backslash:http://www.dba-oracle.com/t_escaping_speci...sql_sqlplus.htmAlso see:
http://www.dba-oracle.com/t_remove_all_spe..._table_rows.htmhttp://www.dba-oracle.com/t_change_all_string_table.htm