Re: How to query up the newline (||) character in SQL editor
Posted in 2005
Not so, Art. You can use the built-in procedure IFX_ALLOW_NEWLINE, demonstrated
as follows:
CREATE TEMP TABLE test_table (test_column VARCHAR(255));
EXECUTE PROCEDURE IFX_ALLOW_NEWLINE('T');
INSERT INTO test_table VALUES ('ab');
SELECT * FROM test_table;
UPDATE test_table
SET test_column = REPLACE(test_column, '
', ' ')
WHERE test_column LIKE '%
%';
SELECT * FROM test_table;
Jason: use the REPLACE function in an UPDATE statement as shown above to fix
your data.
--
Regards,
Doug Lawry
www.douglawry.webhop.org
"Art S. Kagel" <kagel@bloomberg.net> wrote in message
news:42681C7F.5070001@bloomberg.net...
> Jason Ip wrote:
>> I have a bunch of comments rows with just plain text in them but some
>> of them have a newline character in them (||). I need to replace all
>> instances of these newlines (in a certain row) with a blank space, or
>> anything for that matter. I just need to get rid of them.
>>
>> Right now I am just trying to query them out like so: select * from
>> certain_tables where comment like '%(need identifier
>> here)%';
>>
>> what do i put for that identifier to get the newline characters?
>
> You cannot. You'll have to write a host language program in ESQL/C, C-ODBC,
> Perl/DBD/DBI, Java/JDBC, etc. and filter, and correct the data in the host
> program then update the offending rows.
>
> Art S. Kagel
>
>> thanks